OLED doesn't work correctly

jovanni
Posts: 1
Joined: Sat May 04, 2024 10:59 am

OLED doesn't work correctly

Postby jovanni » Sat May 04, 2024 11:18 am

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()
Attachments
IMG_7263.jpg
IMG_7263.jpg (117.93 KiB) Viewed 4393 times

Who is online

Users browsing this forum: No registered users and 29 guests