Bluepill Adafruit_SSD1306 problem

Hi, I`m using latest official STM32 core for the blue-pill and Adafruit_SSD1306 library, it compiles ok, but I get black screen with white noise (pixels) on 0.96 inch I2C display.
Anyone figured out how to make this library work ? ( Other libraries are out of question).

This is the basic sketch I`m using and it works with AVR and ESP without a problem :

#include <Adafruit_SSD1306.h>

#define OLED_I2C_ADDR 0x3C
#define OLED_WIDTH 128
#define OLED_HEIGHT 64

Adafruit_SSD1306 display(OLED_WIDTH, OLED_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()
{

}

Moved to Programming Questions.... Not directly related to Arduino boards or shields.

Btw, I tried to set I2C speed to 100KHz and 400KHz (as an argument of Adafruit_SSD1306 display constructor but no results..)
Any ideas what should I change in library to make it work?
Interesting thing is that library works with old Roger Clark`s STM32 core, but not with the official ST core, I wonder why?

I work with the STM32DUINO core, and it works with Oled Reset 4

Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT, &Wire, 4);
1 Like

NOT working.

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