from machine import Pin, I2C # Import required modules
import ssd1306 # OLED library
import time
# Initialize I2C interface (ESP32: SCL=22, SDA=21)
i2c = I2C(0, scl=Pin(22), sda=Pin(21))
# Initialize OLED display (128x64 pixels)
oled_width = 128
oled_height = 64
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)
while True:
oled.fill(0)
oled.text("Hi", 60, 10) # Display text at (x=10, y=20)
oled.text("I'm Testing", 20, 30)
oled.text("The Code!", 30, 50)
oled.show()
time.sleep(1) #delay for one sec
oled.fill(0)
oled.show()
time.sleep(1)