ESP32 & SSD1306 OLED noname with Adafruit library showing strange behavior

Hi Arduino-fellows,

I am using this OLED:
https://www.amazon.de/ARCELI-OLED-Modul-SSD1306-Serielle-Raspberry/dp/B07J2QWF43/ref=sr_1_3?dchild=1&keywords=arduino+oled&qid=1610386639&sr=8-3

and the newest Adafruit library. I just want to display text as here:

I am using this simple code example:
The only thing I did was putting the code into the loop and it works quite ok but sometimes the text is displayed elsewhere than specified and it looks not perfect. Any ideas? Thank you a lot!

/*********
  Rui Santos
  Complete project details at https://randomnerdtutorials.com  
*********/

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

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

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

void setup() {
  Serial.begin(115200);

  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
    Serial.println(F("SSD1306 allocation failed"));
    for(;;);
  }
  delay(2000);
  display.clearDisplay();

  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0, 10);
  // Display static text
  display.println("Hello, world!");
  display.display(); 
}

void loop() {
  
}

Update: I have just tried a SH1106 based OLED with 1.3inch and the display is prettier but I still get sometimes pixel noise and in particular at the field that is regularly updated, I power it using 3.3V (range is from 3.3-5.0V).

I tend to use the U8G2 library, especially with an ESP32 which has the ram to do the thing. Have you tried another OLED display library to see if the issue does or not do the bad thing?

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