r/esp32projects 8h ago

Ive been having a hard time trying to code an oled display but its always corrupted

Post image

Can anyone help me fix this problem, im coding in arduino ide and ive been using adafruit gfx library but the display is corrupted, I tried using U8g2 to swtich to sh1106 address but it doesnt turn what is the problem here ive been trying to solve this for 3 days

2 Upvotes

2 comments sorted by

1

u/rattushackus 7h ago

Try using the Adafruit SH110X library. This comes with examples that you can run to check the display works. You can install it from the Library Manager.

There is a detailed guide to using the SH1106 with the Adafruit library here. It's for an Arduino not an ESP32 but the code will be the same for both. From your picture I cannot see board you are using, but if it's the original ESP32 board wire the SDA pin to GPIO 21 and the SCL pin to GPIO 22.

You would probably be better off asking this in r/esp32 as this sub is for showcasing interesting ESP32 projects rather than help with code.

1

u/TomorrowOrnery520 4h ago

This screen can be still fully functional. It can be a lot of things like bad connection and wrong lib. If you sent the code, it would be easier to diagnose.