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