Blank lines in OLED 0.96" I2C

I am using my Arduino MEGA with one 0.96" I2C OLED display. I bought this display long ago and I am not sure if its resolution is 128x64 or 128x32.

I kept the 0x3C address in the begin method:

    display = new Adafruit_SSD1306(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
    display->begin(SSD1306_SWITCHCAPVCC, 0x3C); // Address 0x3C for 128x32

But changed the parameters:

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

For several weeks the sketch has been working fine.

Suddenly, yesterday, the image lost quality. Looks like some lines (probably even or odd ones) are blank.

I am not aware that I have changed anything in the sketch (I have tested different ones) or in the hardware. Have I destroyed this display? Could this be solved by doing some kind of reset? Any ideas? Thanks in advance.

Are you sure you didn't replaced the screen or picked different display type in library?
Not all 0.96" displays uses SSD1306 chip to drive them, try different options in the library, for example I have few that has SH1106 driver tho they claim to be SSD1306, I have few others as well. You just have to test all drivers with 128X64 resolutios, yes, your OLED is 128X64.
I had same artifacts when using wrong library settings, your OLED probably fine.

P.S. You do know that SPI and I2C are not the same thing? Cos in your title it says SPI and in pics its obviously I2C....

Hi 3Dgeo,

thanks for pointing out the mismatch between SPI and I2C. I know they are not the same thing. I have updated the title. The display is a I2C device.

I have not changed the HW. Same Arduino MEGA and OLED display. The display had been working fine with the SSD1306 driver. Now, somwthing has happened.

No idea on how to solve it.


did you try other libraries? u8glib is way better in my opinion anyway, try it and post if changing library made any difference.