#include <Wire.h> //I²C-Bibliothek
#include <Adafruit_GFX.h> //Grafik-Bibliothek
#include <Adafruit_SSD1306.h> // Bibliothek, um genau dieses Display
// anzusprechen
// Konfiguration für das Display
#define BREITE 128
#define HOEHE 64
#define RESET_PIN -1 // Wir haben keinen Reset-Pin, also -1
#define I2C_ADDRESS 0x3C
//Bibliothek aufrufen mit Parametern
Adafruit_SSD1306 pupsi(BREITE, HOEHE, &Wire, RESET_PIN);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pupsi.begin(SSD1306_SWITCHCAPVCC, I2C_ADDRESS); // Display anschalten
pupsi.clearDisplay(); // Display einmal leeren
pupsi.setTextSize(2); // Textgröße setzen
pupsi.setTextColor(WHITE); // Textfarbe ändern (BLACK oder WHITE)
pupsi.setCursor(30, 30); // Wo soll mit der Zeile begonnen werden?
// X, Y --> 0, 0 ist links oben
// 128, 64 ist unten rechts
pupsi.println("Hello");
pupsi.display();
}
void loop() {
// put your main code here, to run repeatedly:
pupsi.clearDisplay();
pupsi.setCursor(30, 30);
pupsi.println("PAUSE!");
pupsi.display();
delay(20); // this speeds up the simulation
pupsi.clearDisplay();
pupsi.display();
delay(20);
}