44 lines
No EOL
751 B
Text
44 lines
No EOL
751 B
Text
#include <Wire.h>
|
|
#include <Adafruit_GFX.h>
|
|
#include <Adafruit_SSD1306.h>
|
|
|
|
#define SCREEN_WIDTH 128
|
|
#define SCREEN_HEIGHT 64
|
|
|
|
Adafruit_SSD1306 display(
|
|
SCREEN_WIDTH,
|
|
SCREEN_HEIGHT,
|
|
&Wire,
|
|
-1
|
|
);
|
|
|
|
void showName(String name) {
|
|
display.clearDisplay();
|
|
display.setTextSize(2);
|
|
display.setTextColor(SSD1306_WHITE);
|
|
display.setCursor(0, 20);
|
|
display.println(name);
|
|
display.display();
|
|
}
|
|
|
|
void setup() {
|
|
Wire.begin(21, 22);
|
|
|
|
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
|
|
Serial.begin(115200);
|
|
Serial.println("Display nicht gefunden!");
|
|
while (true);
|
|
}
|
|
|
|
showName("Max");
|
|
delay(2000);
|
|
|
|
showName("Lea");
|
|
delay(2000);
|
|
|
|
showName("Tim");
|
|
delay(2000);
|
|
}
|
|
|
|
void loop() {
|
|
} |