wiring
Let’s start with a picture of NodeMCU
On the last wiring diagram
Explain the oled pins
VCC
: Power supply, connect3v3
Pins. They’re printed on some OLedsVDD
, andVCC
The sameGND
: Grounding, connectionGND
pin
SCL
Clock, find the boardCLK
Pins, you can connect other pins if you don’t want to show the time, hereD5
SDA
: Data transfer, pick up any oneGPIO
Here receivedD3
on
Remember which one I’m connecting to hereGPIO
.SCL
isGPIO0
.SDA
isGPIO14
.
Hello World
Open the serial debugging assistant and open the serial port.
Send the following commands in sequence
from machine import Pin, I2C from ssd1306 import SSD1306_I2C i2c = I2C(scl=Pin(14), Sda =Pin(0) # GPIO OLED = SSD1306_I2C(128, 64, i2c) OLED. Text ("Hello World",0,0) OLED. Show ()Copy the code
The effect of