Error in trying to set up OLED with ESP32 WROOM Module

Having problems trying to set up a 1.3" OLED with an ESP32, anything below the text is cut off and doesn't show up, the scrambled pixels on the right is also odd.


I'm using an ESP-WROOM-32 with the Arduino IDE environment with the U8G2 Library HelloWorld example sketch.

Using the U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); constructor.

Any help is greatly appreciated :smiley:

This looks like a memory mapping problem. Try one of the other constructors for the 1306 128x64 pixel displays. There are a number of variations of this one with different memory mappings. The quickest is probably to just try the likely candidates until you find the one that works. Here's a list of all the constructors; just scroll down through the sections with 1306 and 128x64 displays: u8g2setupcpp ยท olikraus/u8g2 Wiki ยท GitHub

1 Like


Looks like you were right!
Using the U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); constructor seemed to work, however the scrambled pixels still remain, could it be a wiring issue?

That's looking much better already.
I don't know about the vertical line towards the right, but have you powered off the display and then powered back on? This should erase the memory buffer.


Looks like it just removed some of the vertical line, it's odd, when I move or jiggle the wiring it changes, sometimes even to the ")" character???

At this point I would personally continue with writing my own code, starting with a simple clear screen followed by a Hello World, and then see what happens. Odds are we're looking at some glitch in the example code you're using and I personally wouldn't spend time trying to debug it. Your display seems to work fine and the vertical line doesn't look like an obvious hardware issue to me.

Hmmm, you're most likely right and I should just keep on going, however I've tried another example code, and it seems to be doing the same thing?


Mybiotics sample code to be precise.
Can be accessed here
There are animations and it runs through frames with the same vertical line still there...
Now running it on an Arduino UNO just to see if it would differ in results.

My first thought for the controller on a 1.3" OLED would not be a SSD1306, but an SH1106G. The latter has a 2 pixel offset that needs to be accounted for, and would explain your text being cut off on the left and the 2 pixel wide noise on the right.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.