# Program to display on OLED
print("Program to display on OLED")
# Import necessary libraries for OLED
import oled_lib # Replace 'oled_lib' with the correct OLED library
from machine import Pin, SoftI2C
# Pin declaration for I2C communication
i2c = SoftI2C(scl=Pin(22), sda=Pin(21)) # Use correct pins for SCL and SDA
# Object declaration for the OLED screen
oled = oled_lib.SSD1306_I2C(128, 64, i2c) # Initialize OLED with I2C interface
# Main program
while True:
oled.fill(0) # Clear the screen
oled.text("Program to display", 0, 0) # Display text at coordinates (0, 0)
oled.text("on OLED", 0, 10) # Display text at coordinates (0, 10)
oled.text("Date: 4/1/2025", 0, 20) # Display text at coordinates (0, 20)
oled.text("aaaaaaaaa", 0, 30) # Display text at coordinates (0, 30)
oled.show() # Update the display
Loading
esp32-devkit-v1
esp32-devkit-v1