#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
Adafruit_SSD1306 oled2(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
Adafruit_SSD1306 oled3(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
if(!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)){
Serial.println(F("Khoi tao SSD1306 OLED that bai"));
while(1);
}
if(!oled2.begin(SSD1306_SWITCHCAPVCC, 0x3D)){
Serial.println(F("Khoi tao SSD1306 OLED that bai"));
while(1);
}
if(!oled3.begin(SSD1306_SWITCHCAPVCC, 0x3E)){
Serial.println(F("Khoi tao SSD1306 OLED that bai"));
while(1);
}
delay(2000);
oled.clearDisplay();
oled.setTextSize(1);
oled.setTextColor(WHITE);
oled.setCursor(0,2);
oled.println("OLED1");
oled.display();
oled2.clearDisplay();
oled2.setTextSize(1);
oled2.setTextColor(WHITE);
oled2.setCursor(0,2);
oled2.println("OLED2");
oled2.display();
oled3.clearDisplay();
oled3.setTextSize(1);
oled3.setTextColor(WHITE);
oled3.setCursor(0,2);
oled3.println("OLED3");
oled3.display();
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}