#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display (SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup () {
if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS))
for (;;); // halt here
display.clearDisplay();
display.setTextSize(1);
pinMode(2, INPUT_PULLUP);
while (digitalRead(2)){;;}
for (int i = 63; i > 0; i -= 3) {
display.setTextColor(WHITE);
display.setCursor(0, i);
display.println(F("Twas brillig, and theslithy toves Did gyre\nand gimble in th wabe\nAll mimsy were the\nborogoves, And the\nmome raths outgrabe."));
display.display();
display.clearDisplay();
}
}
void loop() { }Loading
ssd1306
ssd1306
Push Me