#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
oled.setRotation(0); // text size
oled.setTextSize(1); // text size
oled.setTextColor(WHITE); // text color
oled.setCursor(0, 10); // position to display
oled.clearDisplay(); // clear display
// oled.println("Hello World!"); // text to display
// oled.drawLine(23, 0, 34, 0, 1);
oled.display(); // show on OLED
}
void loop() {
for (int i = 0; i < SCREEN_WIDTH; i++) {
oled.drawLine(128 - i, 0, 128 - i, SCREEN_HEIGHT - 1, 1);
oled.display();
oled.drawLine(128 - i, 0, 128 - i, SCREEN_HEIGHT - 1, 0);
delay(10);
}
}