Arduino Nano I2C OLED display 0.96 inches 128x64 pixels

I have a strange issue while trying to run the hello world code on an arduino nano connected to an OLED display.

This is the code I used:

    #include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 64, &Wire);

void setup() {

  // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Address 0x3C for 128x32

  display.display();
  delay(2000);

  display.clearDisplay();      //this line to clear previous logo
  display.setTextColor(WHITE); //without this no display
  display.print("Hello World!");//your TEXT here
  display.display();            //to shows or update your TEXT
}

void loop() {

 }

But I get this on the display.

Any idea what I could be missing?

Thanks !

You are probably missing nothing.
The simulation of your sketch works:

Your OLED display might do something weird.
I assume that if you buy a OLED from Adafruit, that it will work.
Do you see the logo appearing on your OLED display ?

The address jumper on the back of the display does not seem to match the address you are calling in your code. 0x3C //for a 128x32 display vs. (what appears to be 0x7? (maybe 70 or 78 or 7B) on the back of the board.

However, I would think you would get nothing displayed at all!

If that is not an Adafruit sourced display, it might not be a SSD1306 control chip.

Looks like a problem with the font, the exclamation mark is correct, and the characters are consistent where they appear more than once (the double l in Hello and the o on each word).

I recall seeing a similar when I first used that display. I never knew what the real problem was. It might have been me. You might find this link useful.

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