#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define LEBAR_LAYAR 128
#define TINGGI_LAYAR 64
Adafruit_SSD1306 oled(LEBAR_LAYAR, TINGGI_LAYAR, &Wire, -1);
void setup() {
Serial.begin(9600);
// initialize OLED display with I2C address 0x3C
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}
void loop() {
oled.clearDisplay(); // clear display
oled.fillScreen(WHITE); // warna background
oled.setTextSize(1); // ukuran text
oled.setTextColor(BLACK); // warna text
oled.setCursor(0, 10); // Atur posisi text
oled.println("Hello World");
oled.display(); // menampilkan display OLED
}