Page 1 of 1

OLED doesn't work correctly

Posted: Sat May 04, 2024 11:18 am
by jovanni
I make my first steps with ESP32 WROOM 32 Dev board and MicroPython (with Thonny).
My small OLED 128x32 0.91" works fine. But my big OLEDs 128x64 1.3" (I have three of them, differnt suppliers) do show only trash. I tried different ssd1306 libraries and the trash changes, but its still trash.
What do I make wrong?



here my code:
from machine import Pin, I2C
import ssd1306
import time

# Set up I2C communication
i2c = I2C(-1, scl=Pin(22), sda=Pin(21))

# Define OLED parameters
oled_width = 128
oled_height = 64


# Initialize OLED display
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)

# Clear the display
oled.fill(0)
oled.show()

# Display text
oled.text("Line 1", 0, 0)
oled.text("Line 2", 0, 20)
oled.text("Line 3", 0, 40)
oled.show()