SSD1306 OLED STM32f411 not connecting
Posted: Fri Jul 05, 2024 10:26 am
Hi,
I have gone through all the posts here regarding SSD1306 OLED issues and surfed the internet for solutions.
I have tested with Arduino Nano and STM32 connected on CLK PB6 / SDA PB7:
pic1: Arduino Nano with SSD1306 works
pic2: STM32f411 with TM1637 4 digit LED display works
pic3: STM32f411 with SSD1306 doesn't turn display on.
I am using this Adafruit 1306 code
https://randomnerdtutorials.com/guide-f ... h-arduino/
This is the main part of the code - this works on Arduino
#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();
I have gone through all the posts here regarding SSD1306 OLED issues and surfed the internet for solutions.
I have tested with Arduino Nano and STM32 connected on CLK PB6 / SDA PB7:
pic1: Arduino Nano with SSD1306 works
pic2: STM32f411 with TM1637 4 digit LED display works
pic3: STM32f411 with SSD1306 doesn't turn display on.
I am using this Adafruit 1306 code
https://randomnerdtutorials.com/guide-f ... h-arduino/
This is the main part of the code - this works on Arduino
#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();