from machine import Pin, I2C
import ssd1306
import time
i2c = I2C(
0,
scl=Pin(22),
sda=Pin(21),
freq=400000
)
oled_width = 128
oled_height = 64
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)
while True:
oled.fill(0)
oled.text("ESP32 + OLED", 0, 0)
oled.text("MicroPython", 0, 20)
oled.text("Wokwi Test", 0, 40)
oled.show()
time.sleep(2)
oled.fill(0)
oled.text("Hello!", 40, 25)
oled.show()
time.sleep(2)