Curious Issue with a 128x32 OLED on i2c

Hi all,

I have a small bug with my 128x32 isc OLED display which seems to happen if I try to update it too fast. When on one particular “page” on my code displaying a fill bar using the adafruit library, I’m testing it out by changing the value to be displayed by moving a potentiometer. The pot can be a little noisy, and if the value starts to change quickly due to noise, the display develops a bug where all pixels shift down by one row, and sometimes a line of lit pixels is seen on the top row.

My primary fix is to try to minimise the screen update rate but I’d just like to know what is actually happening here and why does it do this so I can effectively solve the issue.

Thanks in advance!

Post your code.

The Adafruit_SSD1306 library does not update the screen until you specifically tell it to with oled.display()
It blocks until completion.


Here’s the code… The specific part that I can provoke the problem with is the fuelbar part from line 1182. The fuel value gets sent in via Serial1

RocketDash.ino (63.4 KB)

Your display_FuelR() function updates the OLED buffer contents. Then calls display.display() to re-write the whole screen.

From memory, this display.display() call will block until complete. (but it does not take long to write 512 bytes on a 400kHz I2C bus)
However things like Serial interrupts should still operate.
I don’t see a problem.

You have an awful lot of variables. Fine for a 128x32.
You might be tight for SRAM on a Uno.

What does the verbose build report say ?