You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Arduino IDE version (found in Arduino -> About Arduino menu): 2.1.1
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too):
My problem
I can't use 2 SSD1306 at the same time.
I have 2 SSD1306 128x64 but when I define SSD1306_128_64 in the Adafruit_SSD1306.h program, it doesn't work (only on 1 screen).
I only can define 1 screen if I use the "new way", display(w,h,wire,-1) and I didn't find a solution in the forum.
I can define SSD1306_128_32, it works, but the words size is too big for my application.
My Sketch :
#include <Wire.h>
#include <Adafruit_SSD1306.h>
void setup() {
// Initialisation des écrans avec leurs adresses I2C
display1.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display2.begin(SSD1306_SWITCHCAPVCC, 0x3D);
// Le reste de votre configuration
}
void loop() {
// Contrôlez les écrans individuellement ici
// Exemple : Afficher du texte sur le premier écran
display1.clearDisplay();
display1.setTextColor(SSD1306_WHITE);
display1.setCursor(0, 0);
display1.println("Oh");
display1.display();
// Exemple : Afficher du texte sur le deuxième écran
display2.clearDisplay();
display2.setTextColor(SSD1306_WHITE);
display2.setCursor(0, 0);
display2.println("mince");
display2.display();
// Le reste de votre code loop
}
The text was updated successfully, but these errors were encountered:
You should check the return value from display.begin() to see if the memory allocation is failing. The Uno has little RAM and may not be able to support multiple OLEDs. A version of the above code does work on the RP2040 (Raspberry Pi Pico). I verified this code does work with two displays on the same I2C bus:
Arduino board: ARDUINO UNO
Arduino IDE version (found in Arduino -> About Arduino menu): 2.1.1
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too):
My problem
I can't use 2 SSD1306 at the same time.
I have 2 SSD1306 128x64 but when I define SSD1306_128_64 in the Adafruit_SSD1306.h program, it doesn't work (only on 1 screen).
I only can define 1 screen if I use the "new way", display(w,h,wire,-1) and I didn't find a solution in the forum.
I can define SSD1306_128_32, it works, but the words size is too big for my application.
My Sketch :
#include <Wire.h>
#include <Adafruit_SSD1306.h>
//Adafruit_SSD1306 ecranOLED0(128, 64, &Wire, -1);
//Adafruit_SSD1306 ecranOLED1(128, 64, &Wire, -1);
Adafruit_SSD1306 display1(0);
Adafruit_SSD1306 display2(1);
void setup() {
// Initialisation des écrans avec leurs adresses I2C
display1.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display2.begin(SSD1306_SWITCHCAPVCC, 0x3D);
// Le reste de votre configuration
}
void loop() {
// Contrôlez les écrans individuellement ici
// Exemple : Afficher du texte sur le premier écran
display1.clearDisplay();
display1.setTextColor(SSD1306_WHITE);
display1.setCursor(0, 0);
display1.println("Oh");
display1.display();
// Exemple : Afficher du texte sur le deuxième écran
display2.clearDisplay();
display2.setTextColor(SSD1306_WHITE);
display2.setCursor(0, 0);
display2.println("mince");
display2.display();
// Le reste de votre code loop
}
The text was updated successfully, but these errors were encountered: