Hi!
I actually try to use two OLED SSD1306 ( Product Code : RB-Elf-196) for a future controller (that’s why there is a mcp23017 in the center of the solderless breadboard, which is currently unused) and, with the adafruit library, I can use them quickly.
But I have a weird problem: if I put the HEIGHT dimension to the wrong size of 32, all is working well,
I want the correct height size of 64. The issue is; when I put 64 instead of 32, the second oled don’t show anything.
In the test code*, the screen who will display is the last I2C address called. ( In the picture, the 0x3C is the bottom oled)
I know that is a software problem. I already tried to change arduino, change the screens, change all wire and the result is always the same.
If I only use one OLED, ( the bottom oled address is 0x3D and the other one is 0x3C), all run perfectly without physical modification.
I’m using Arduino IDE 1.8.10, the driver for oled is Adafruit SSD1306 v1.3.0.
*This is the code I use for try to start the two oled:
#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
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display1(SCREEN_WIDTH, SCREEN_HEIGHT , &Wire, OLED_RESET);
Adafruit_SSD1306 display2(SCREEN_WIDTH, SCREEN_HEIGHT , &Wire, OLED_RESET);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200); //pc
display1.begin(SSD1306_SWITCHCAPVCC, 0x3D);
display2.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display1.display();
display2.display();
}
void loop() {
// put your main code here, to run repeatedly:
}
Thank for your help.