Arduino UNO Q - OLED 128x64

In diesem Tutorial erfahren Sie, wie Sie ein SSD1306 OLED 128x64-Display mit Arduino UNO Q verwenden — von grundlegendem Text bis hin zu Formen, Bildern und Telegram-Fernsteuerung.

Arduino UNO Q - OLED 128x64

Erforderliche Hardware

1×Arduino UNO Q
1×USB-Kabel für Arduino Uno Q
1×SSD1306 I2C OLED-Display 128x64
1×Jumper-Drähte
1×(Empfohlen) Schraubklemmenblock-Shield für Arduino Uno
1×(Empfohlen) Sensors/Servo Expansion Shield for Arduino Uno
1×(Empfohlen) Breadboard-Shield für Arduino Uno
1×(Empfohlen) Gehäuse für Arduino Uno
1×(Empfohlen) Prototyping-Grundplatte & Breadboard-Kit für Arduino Uno

Oder Sie können die folgenden Kits kaufen:

1×DIYables Sensor-Kit (18 Sensoren/Displays)
Offenlegung: Einige der in diesem Abschnitt bereitgestellten Links sind Amazon-Affiliate-Links. Wir können eine Provision für Käufe erhalten, die über diese Links getätigt werden, ohne zusätzliche Kosten für Sie. Wir schätzen Ihre Unterstützung.

Kaufhinweis: Wenn Sie ein größeres OLED-Display möchten, verwenden Sie das 2.42 inch OLED Display 128x64.

Über OLED 128x64-Display

Das SSD1306 OLED 128x64 ist ein kompaktes monochromes Display, das vom SSD1306-Controller über I2C gesteuert wird. Es hat 128 × 64 Pixel und kann scharfen Text, Symbole, Diagramme und benutzerdefinierte Grafiken anzeigen.

OLED-Pinbelegung

  • GND — mit GND verbinden
  • VCC — mit 3,3 V oder 5 V verbinden
  • SCL — I2C-Taktsignal
  • SDA — I2C-Datensignal
OLED-Pinbelegung

※ Notiz:

Die Pin-Reihenfolge kann je nach Hersteller unterschiedlich sein. Beachten Sie immer die Beschriftungen auf dem OLED-Modul selbst. In diesem Tutorial wird ein auf SSD1306 basierendes OLED verwendet und mit DIYables-Modulen getestet.

Schaltplan

Arduino UNO Q OLED 128x64 Schaltplan

Dieses Bild wurde mit Fritzing erstellt. Klicken Sie, um das Bild zu vergrößern.

OLED-PinArduino UNO Q Pin
GNDGND
VCC3,3 V
SCLSCL
SDASDA

So programmieren Sie das OLED

Die Adafruit SSD1306-Bibliothek bietet alle Funktionen, die zum Steuern des OLED erforderlich sind.

  • Bibliotheken einbinden:
#include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h>
  • OLED-Objekt erstellen (128x64):
#define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
  • In setup() initialisieren:
if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { while (true); // halt if OLED not found } oled.clearDisplay();
  • Text anzeigen:
oled.setTextSize(1); // Font size (1–8) oled.setTextColor(WHITE); // Text color oled.setCursor(0, 0); // Cursor position (x, y) oled.println("Hello!"); oled.display(); // Push buffer to screen — required!

※ Notiz:

Rufen Sie immer oled.display() nach Zeichnungsbefehlen auf, um den Puffer zum Bildschirm zu übertragen. Zeichnungsbefehle allein aktualisieren nicht das Sichtbare.

Arduino UNO Q-Code — Hallo Welt auf SSD1306 OLED

Das Arduino UNO Q hat zwei Prozessoren: die STM32-MCU (verarbeitet Hardware-Echtzeit-Steuerung) und die Qualcomm-MPU (führt Debian Linux aus). In diesem Abschnitt wird nur die STM32-MCU programmiert — die Linux-Seite bleibt untätig. Ein späterer Abschnitt zeigt, wie beide Prozessoren zusammenarbeiten.

Die folgende Skizze zeigt Text in zwei verschiedenen Größen auf dem OLED.

/* * Dieser Arduino UNO Q Code wurde von newbiely.de entwickelt * Dieser Arduino UNO Q Code wird der Öffentlichkeit ohne jegliche Einschränkung zur Verfügung gestellt. * Für vollständige Anleitungen und Schaltpläne besuchen Sie bitte: * https://newbiely.de/tutorials/arduino-uno-q/arduino-uno-q-oled-128x64 */ #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { Monitor.begin(9600); if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Monitor.println(F("SSD1306 allocation failed")); for (;;); } delay(2000); oled.clearDisplay(); // Line 1 — size 1 oled.setTextSize(1); oled.setTextColor(WHITE); oled.setCursor(0, 0); oled.println(F("Hello, World!")); // Line 2 — size 2 oled.setTextSize(2); oled.setCursor(0, 20); oled.println(F("DIYables")); // Line 3 — size 1 oled.setTextSize(1); oled.setCursor(0, 50); oled.println(F("OLED 128x64 SSD1306")); oled.display(); } void loop() {}

Schnelle Schritte

  • Erste Male mit Arduino UNO Q? Folgen Sie dem Tutorial Erste Schritte mit Arduino UNO Q, um Ihre Entwicklungsumgebung vorzubereiten, bevor Sie fortfahren.
  • OLED verdrahten: Verbinden Sie GND→GND, VCC→3,3 V, SCL→SCL, SDA→SDA.
  • Verbinden: Stecken Sie Arduino UNO Q mit einem USB-C-Kabel an Ihren Computer.
  • Arduino App Lab öffnen: Starten Sie Arduino App Lab und warten Sie, bis es Ihren Arduino UNO Q erkennt.
  • Neue App erstellen: Klicken Sie auf die Schaltfläche Neue App erstellen.
Neue App in Arduino App Lab auf Arduino UNO Q erstellen
  • Geben Sie der App einen Namen, z. B.: DIYables_OLED_128x64
  • Klicken Sie auf Erstellen, um zu bestätigen.
  • Sie sehen einen Satz von Ordnern und Dateien, die in Ihrer neuen App generiert werden.
Arduino App Lab App-Ordner und Dateien auf Arduino UNO Q
  • Suchen Sie die Datei sketch/sketch.ino — hier fügen Sie die MCU-Skizze ein.
  • Skizze einfügen: Kopieren Sie den MCU-Code oben und fügen Sie ihn in die Skizzendatei ein.
    • Install the library: Click the Add sketch library button (the open book icon with a + sign) in the left sidebar.
    Add sketch library in Arduino App Lab on Arduino UNO Q
    • Search for Arduino_RouterBridge created by Arduino and click the Install button.
    My Apps / DIYables Apps
    Run
    Bricks
    No bricks added...
    Sketch Libraries
    No sketch libra...
    Files
    python
    sketch
    .gitignore
    README.md
    app.yaml
    sketch.ino
    Add sketch library
    Arduino_RouterBridge Arduino

    This library provides a simple RPC bridge for Arduino UNO Q boards, allowing communication between the board and other devices using MsgPack serialization.

    0.4.1
    Install
    More Info
    • Search for Adafruit SSD1306 created by Adafruit and click the Install button.
    My Apps / DIYables Apps
    Run
    Bricks
    No bricks added...
    Sketch Libraries
    No sketch libra...
    Files
    python
    sketch
    .gitignore
    README.md
    app.yaml
    sketch.ino
    Add sketch library
    Adafruit SSD1306 Adafruit

    SSD1306 oled driver library for monochrome 128x64 and 128x32 displays

    2.5.9
    Install
    More Info
    • Hochladen: Klicken Sie in Arduino App Lab auf die Schaltfläche Ausführen, um zu kompilieren und auf die STM32 hochzuladen.
    Klicken Sie in Arduino App Lab auf Arduino UNO Q auf die Schaltfläche Ausführen

    Schauen Sie auf das OLED — es zeigt "Hallo, Welt!", "DIYables" und "OLED 128x64 SSD1306"!

    Arduino UNO Q-Code — Text auf SSD1306 OLED anzeigen

    Dieses Beispiel demonstriert verschiedene Textgrößen und wie Sie Ganzzahlen, Gleitkommazahlen und Hexadezimalzahlen auf dem OLED anzeigen.

    /* * Dieser Arduino UNO Q Code wurde von newbiely.de entwickelt * Dieser Arduino UNO Q Code wird der Öffentlichkeit ohne jegliche Einschränkung zur Verfügung gestellt. * Für vollständige Anleitungen und Schaltpläne besuchen Sie bitte: * https://newbiely.de/tutorials/arduino-uno-q/arduino-uno-q-oled-128x64 */ #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { Monitor.begin(9600); if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Monitor.println(F("SSD1306 allocation failed")); for (;;); } delay(2000); // ── Text size demo ── oled.clearDisplay(); oled.setTextColor(WHITE); oled.setTextSize(1); oled.setCursor(0, 0); oled.println(F("Size 1: Arduino")); oled.setTextSize(2); oled.setCursor(0, 16); oled.println(F("Size 2")); oled.setTextSize(3); oled.setCursor(0, 40); oled.println(F("S3")); oled.display(); delay(3000); // ── Integer ── oled.clearDisplay(); oled.setTextSize(2); oled.setCursor(0, 0); oled.print(F("Int: ")); oled.println(12345); oled.display(); delay(3000); // ── Float ── oled.clearDisplay(); oled.setTextSize(2); oled.setCursor(0, 0); oled.print(F("Float:")); oled.setCursor(0, 24); oled.println(3.14); oled.display(); delay(3000); // ── Hexadecimal ── oled.clearDisplay(); oled.setTextSize(2); oled.setCursor(0, 0); oled.print(F("Hex: ")); oled.println(255, HEX); oled.display(); delay(3000); } void loop() {}

    Schnelle Schritte

    • Kopieren Sie den Code oben und fügen Sie ihn in sketch/sketch.ino ein.
    • Klicken Sie in Arduino App Lab auf die Schaltfläche Ausführen.
    Klicken Sie in Arduino App Lab auf Arduino UNO Q auf die Schaltfläche Ausführen

    Das OLED wechselt durch Textgrößen-Demos, zeigt dann eine Ganzzahl, eine Gleitkommazahl und eine Hexadezimalzahl an.

    Nützliche Referenz zu Anzeigebefehlen

    Kurzverweis für häufig verwendete SSD1306 OLED-Funktionen:

    • oled.clearDisplay() — Rahmenpuffer löschen (alle Pixel aus)
    • oled.display() — Puffer zum Bildschirm schieben — nach jedem Zeichnungsbefehl erforderlich
    • oled.drawPixel(x, y, color) — einzelnes Pixel setzen oder löschen
    • oled.setTextSize(n) — Schriftart um Faktor *n* skalieren (1 = 6×8 px, 2 = 12×16 px, …)
    • oled.setCursor(x, y) — Textcursor zu Pixelkoordinaten *(x, y)* verschieben
    • oled.setTextColor(WHITE) — nur Textvordergrund (transparenter Hintergrund)
    • oled.setTextColor(BLACK, WHITE) — Text mit ausdrücklichem Hintergrund
    • oled.println("message") — Zeichenkette drucken und zur nächsten Zeile wechseln
    • oled.println(number) — Ganzzahl in Dezimalzahl drucken
    • oled.println(number, HEX) — Ganzzahl in Hexadezimalzahl drucken
    • oled.startscrollright(start, stop) — Hardware-Scroll rechts zwischen Seiten
    • oled.startscrollleft(start, stop) — Hardware-Scroll links
    • oled.startscrolldiagright(start, stop) — diagonales Scrollen nach rechts
    • oled.startscrolldiagleft(start, stop) — diagonales Scrollen nach links
    • oled.stopscroll() — alle aktiven Hardware-Scrolls stoppen
    • oled.setContrast(value) — Helligkeit anpassen (0–255)
    • oled.dim(true/false) — schnelle Dimmumschaltung
    • oled.invertDisplay(true/false) — Hardware-Farb-Inversion

    Arduino UNO Q-Code — Formen auf SSD1306 OLED zeichnen

    Die Adafruit SSD1306-Bibliothek erbt von Adafruit_GFX und bietet Ihnen Pixel, Linien, Rechtecke, Kreise, Dreiecke und abgerundete Rechtecke. Die folgende Skizze wechselt durch alle.

    /* * Dieser Arduino UNO Q Code wurde von newbiely.de entwickelt * Dieser Arduino UNO Q Code wird der Öffentlichkeit ohne jegliche Einschränkung zur Verfügung gestellt. * Für vollständige Anleitungen und Schaltpläne besuchen Sie bitte: * https://newbiely.de/tutorials/arduino-uno-q/arduino-uno-q-oled-128x64 */ #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { Monitor.begin(9600); if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Monitor.println(F("SSD1306 allocation failed")); for (;;); } delay(2000); oled.clearDisplay(); oled.display(); } void loop() { // ── Single pixel ── oled.clearDisplay(); for (int i = 0; i < SCREEN_WIDTH; i += 4) oled.drawPixel(i, SCREEN_HEIGHT / 2, WHITE); oled.display(); delay(2000); // ── Lines ── oled.clearDisplay(); oled.drawLine(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, WHITE); oled.drawLine(SCREEN_WIDTH - 1, 0, 0, SCREEN_HEIGHT - 1, WHITE); oled.display(); delay(2000); // ── Rectangle ── oled.clearDisplay(); oled.drawRect(10, 10, 108, 44, WHITE); oled.display(); delay(2000); // ── Filled rectangle ── oled.clearDisplay(); oled.fillRect(10, 10, 108, 44, WHITE); oled.display(); delay(2000); // ── Rounded rectangle ── oled.clearDisplay(); oled.drawRoundRect(10, 10, 108, 44, 8, WHITE); oled.display(); delay(2000); // ── Filled rounded rectangle ── oled.clearDisplay(); oled.fillRoundRect(10, 10, 108, 44, 8, WHITE); oled.display(); delay(2000); // ── Circle ── oled.clearDisplay(); oled.drawCircle(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 28, WHITE); oled.display(); delay(2000); // ── Filled circle ── oled.clearDisplay(); oled.fillCircle(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 28, WHITE); oled.display(); delay(2000); // ── Triangle ── oled.clearDisplay(); oled.drawTriangle(64, 4, 10, 60, 118, 60, WHITE); oled.display(); delay(2000); // ── Filled triangle ── oled.clearDisplay(); oled.fillTriangle(64, 4, 10, 60, 118, 60, WHITE); oled.display(); delay(2000); }

    Schnelle Schritte

    • Kopieren Sie den Code oben und fügen Sie ihn in sketch/sketch.ino ein.
    • Klicken Sie in Arduino App Lab auf die Schaltfläche Ausführen.
    Klicken Sie in Arduino App Lab auf Arduino UNO Q auf die Schaltfläche Ausführen

    Schauen Sie zu, wie das OLED alle Formen wechselt — Pixel, Linien, Rechtecke, Kreise, abgerundete Rechtecke und Dreiecke!

    Arduino UNO Q-Code — Hardware-Scrolling auf SSD1306 OLED

    Das SSD1306 verfügt über eine integrierte Hardware-Scrolling-Engine, die Inhalte ohne CPU-Arbeit verschiebt. Die Bibliothek bietet vier Scrollrichtungen: rechts, links, diagonal-rechts und diagonal-links.

    ※ Notiz:

    Rufen Sie immer oled.display() auf, um Ihren Inhalt zum OLED zu übertragen, bevor Sie einen Scroll starten. Rufen Sie stopscroll() auf, bevor Sie neue Inhalte zeichnen.

    /* * Dieser Arduino UNO Q Code wurde von newbiely.de entwickelt * Dieser Arduino UNO Q Code wird der Öffentlichkeit ohne jegliche Einschränkung zur Verfügung gestellt. * Für vollständige Anleitungen und Schaltpläne besuchen Sie bitte: * https://newbiely.de/tutorials/arduino-uno-q/arduino-uno-q-oled-128x64 */ #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { Monitor.begin(9600); if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Monitor.println(F("SSD1306 allocation failed")); for (;;); } delay(2000); oled.clearDisplay(); oled.setTextSize(2); oled.setTextColor(WHITE); oled.setCursor(10, 24); oled.println(F("DIYables")); oled.display(); } void loop() { // Scroll right oled.startscrollright(0x00, 0x07); delay(3000); oled.stopscroll(); delay(500); // Scroll left oled.startscrollleft(0x00, 0x07); delay(3000); oled.stopscroll(); delay(500); // Diagonal scroll right oled.startscrolldiagright(0x00, 0x07); delay(3000); oled.stopscroll(); delay(500); // Diagonal scroll left oled.startscrolldiagleft(0x00, 0x07); delay(3000); oled.stopscroll(); delay(500); }

    Schnelle Schritte

    • Kopieren Sie den Code oben und fügen Sie ihn in sketch/sketch.ino ein.
    • Klicken Sie in Arduino App Lab auf die Schaltfläche Ausführen.
    Klicken Sie in Arduino App Lab auf Arduino UNO Q auf die Schaltfläche Ausführen

    Das OLED scrollt "DIYables" rechts, links, diagonal-rechts und diagonal-links und wiederholt sich endlos.

    Arduino UNO Q-Code — Bitmap-Bild auf SSD1306 OLED anzeigen

    Um ein Bitmap auf dem SSD1306 OLED anzuzeigen, müssen Sie Ihr Bild zunächst in ein C-Byte-Array konvertieren. Verwenden Sie das kostenlose Image to Bitmap Converter-Tool:

    1. Laden Sie Ihre Bilddatei (PNG, JPG, BMP, usw.) hoch.
    2. Stellen Sie die Canvasgröße auf 128 × 64 (oder kleiner) ein.
    3. Wählen Sie Arduino-Code als Ausgabeformat.
    4. Kopieren Sie das generierte Array in Ihre Skizze.
    Bild zu Bitmap-Array

    Die folgende Skizze zeigt ein 16 × 16-Herzsymbol und schaltet dann zum vollständigen 128 × 64-Arduino-Symbol um — beide als Byte-Arrays im Code gespeichert:

    /* * Dieser Arduino UNO Q Code wurde von newbiely.de entwickelt * Dieser Arduino UNO Q Code wird der Öffentlichkeit ohne jegliche Einschränkung zur Verfügung gestellt. * Für vollständige Anleitungen und Schaltpläne besuchen Sie bitte: * https://newbiely.de/tutorials/arduino-uno-q/arduino-uno-q-oled-128x64 */ #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); // 16x16 heart bitmap const unsigned char heart16x16[] PROGMEM = { 0x00, 0x00, 0x03, 0xc0, 0x0f, 0xf0, 0x1f, 0xf8, 0x3f, 0xfc, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfe, 0x3f, 0xfc, 0x1f, 0xf8, 0x0f, 0xf0, 0x03, 0xc0, 0x00, 0x00 }; // 128x64 Arduino icon bitmap const unsigned char ArduinoIcon[] PROGMEM = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xfc, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xfc, 0x00, 0x00, 0xff, 0xfc, 0x00, 0x03, 0xff, 0xfc, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xf8, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x00, 0x3f, 0xf0, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x7f, 0xf0, 0x00, 0x1f, 0xff, 0xff, 0xc0, 0x00, 0x1f, 0xe0, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x7f, 0xf0, 0x00, 0x7f, 0xff, 0xff, 0xe0, 0x00, 0x0f, 0xc0, 0x00, 0x1f, 0xff, 0xff, 0xf8, 0x00, 0x3f, 0xe0, 0x00, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x07, 0x80, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x1f, 0xe0, 0x00, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x03, 0x80, 0x00, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x1f, 0xc0, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x03, 0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x1f, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x07, 0xff, 0xf0, 0x7f, 0xff, 0x00, 0x0f, 0xc0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x0f, 0xff, 0xf0, 0x7f, 0xff, 0x80, 0x0f, 0x80, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x1f, 0xff, 0xf0, 0x7f, 0xff, 0x80, 0x07, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x3f, 0xff, 0xf0, 0x7f, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x7f, 0xff, 0xf0, 0x7f, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xfe, 0x00, 0x00, 0xff, 0xfc, 0x00, 0x00, 0xff, 0xfc, 0x00, 0x03, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xfe, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x01, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xfe, 0x00, 0x00, 0xff, 0xff, 0x00, 0x03, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xfe, 0x00, 0x00, 0xff, 0xff, 0x00, 0x03, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xfe, 0x00, 0x00, 0xff, 0xff, 0x00, 0x03, 0xff, 0xfc, 0x00, 0x01, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x01, 0xff, 0xff, 0xe0, 0x7f, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x7f, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x7f, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x7f, 0xff, 0xf0, 0x7f, 0xff, 0xc0, 0x07, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x3f, 0xff, 0xf0, 0x7f, 0xff, 0x80, 0x07, 0x80, 0x07, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x1f, 0xff, 0xf0, 0x7f, 0xff, 0x80, 0x07, 0xc0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x80, 0x0f, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xe0, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x03, 0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x1f, 0xe0, 0x00, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x07, 0x80, 0x00, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x1f, 0xe0, 0x00, 0x7f, 0xff, 0xff, 0xf0, 0x00, 0x0f, 0xc0, 0x00, 0x3f, 0xff, 0xff, 0xf8, 0x00, 0x3f, 0xf0, 0x00, 0x3f, 0xff, 0xff, 0xe0, 0x00, 0x1f, 0xe0, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x3f, 0xf8, 0x00, 0x1f, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xe0, 0x00, 0x07, 0xff, 0xff, 0xe0, 0x00, 0x7f, 0xf8, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x03, 0xff, 0xff, 0xc0, 0x00, 0x7f, 0xfc, 0x00, 0x03, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xfc, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x01, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x01, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; void setup() { Monitor.begin(9600); if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Monitor.println(F("SSD1306 allocation failed")); for (;;); } delay(2000); // Show heart icon centered oled.clearDisplay(); oled.drawBitmap( (SCREEN_WIDTH - 16) / 2, (SCREEN_HEIGHT - 16) / 2, heart16x16, 16, 16, WHITE); oled.display(); delay(3000); // Show full Arduino icon oled.clearDisplay(); oled.drawBitmap(0, 0, ArduinoIcon, SCREEN_WIDTH, SCREEN_HEIGHT, WHITE); oled.display(); } void loop() {}

    Schnelle Schritte

    • Kopieren Sie den Code oben und fügen Sie ihn in sketch/sketch.ino ein.
    • Klicken Sie in Arduino App Lab auf die Schaltfläche Ausführen.
    Klicken Sie in Arduino App Lab auf Arduino UNO Q auf die Schaltfläche Ausführen

    Das OLED zeigt 3 Sekunden lang das Herzsymbol, dann schaltet es zum Arduino-Symbol um.

    ※ Notiz:

    Bitmap-Dimensionen dürfen die Bildschirmauflösung nicht überschreiten (128 × 64).

    Arduino UNO Q-Code — Kontrast und Dimmen auf SSD1306 OLED

    Das SSD1306 unterstützt 256 Kontraststufen (0–255). Verwenden Sie setContrast() für genaue Steuerung und dim() für eine schnelle Helligkeitsumschaltung.

    /* * Dieser Arduino UNO Q Code wurde von newbiely.de entwickelt * Dieser Arduino UNO Q Code wird der Öffentlichkeit ohne jegliche Einschränkung zur Verfügung gestellt. * Für vollständige Anleitungen und Schaltpläne besuchen Sie bitte: * https://newbiely.de/tutorials/arduino-uno-q/arduino-uno-q-oled-128x64 */ #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { Monitor.begin(9600); if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Monitor.println(F("SSD1306 allocation failed")); for (;;); } delay(2000); // Draw a checkerboard test pattern oled.clearDisplay(); for (int x = 0; x < SCREEN_WIDTH; x += 8) for (int y = 0; y < SCREEN_HEIGHT; y += 8) if ((x / 8 + y / 8) % 2 == 0) oled.fillRect(x, y, 8, 8, WHITE); oled.display(); delay(2000); } void loop() { // Ramp up: 0 → 255 for (int c = 0; c <= 255; c += 5) { oled.setContrast((uint8_t)c); delay(30); } delay(1000); // Ramp down: 255 → 0 for (int c = 255; c >= 0; c -= 5) { oled.setContrast((uint8_t)c); delay(30); } delay(1000); // Quick dim toggle oled.dim(true); // minimum brightness delay(2000); oled.dim(false); // restore delay(2000); }

    Schnelle Schritte

    • Kopieren Sie den Code oben und fügen Sie ihn in sketch/sketch.ino ein.
    • Klicken Sie in Arduino App Lab auf die Schaltfläche Ausführen.
    Klicken Sie in Arduino App Lab auf Arduino UNO Q auf die Schaltfläche Ausführen

    Schauen Sie zu, wie die OLED-Helligkeit nach oben und unten ansteigt, gefolgt von einem Dimm-An/Dimm-Aus-Zyklus.

    Arduino UNO Q-Code — Benutzerdefinierte externe Schriftarten auf SSD1306 OLED

    Die Adafruit GFX-Bibliothek enthält viele FreeFont-Schrifttypen (Serif, Sans, Mono — in mehreren Größen). Verwenden Sie sie, indem Sie den Schriftkopf einbinden und setFont() aufrufen.

    ※ Notiz:

    Wenn eine externe Schriftart aktiv ist, bezieht sich die Cursor-Y-Koordinate auf die Text-Basislinie, nicht die obere linke Ecke. Dies unterscheidet sich von der integrierten 5 × 7-Schriftart.

    /* * Dieser Arduino UNO Q Code wurde von newbiely.de entwickelt * Dieser Arduino UNO Q Code wird der Öffentlichkeit ohne jegliche Einschränkung zur Verfügung gestellt. * Für vollständige Anleitungen und Schaltpläne besuchen Sie bitte: * https://newbiely.de/tutorials/arduino-uno-q/arduino-uno-q-oled-128x64 */ #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #include <Fonts/FreeSerif9pt7b.h> #include <Fonts/FreeSansBold12pt7b.h> #include <Fonts/FreeMono9pt7b.h> #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { Monitor.begin(9600); if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Monitor.println(F("SSD1306 allocation failed")); for (;;); } delay(2000); oled.clearDisplay(); oled.display(); } void loop() { // ── Built-in 5×7 font ── oled.clearDisplay(); oled.setFont(NULL); oled.setTextSize(1); oled.setTextColor(WHITE); oled.setCursor(0, 0); oled.println(F("Built-in 5x7 font")); oled.println(); oled.setTextSize(2); oled.println(F("DIYables")); oled.display(); delay(3000); // ── FreeSerif 9pt ── oled.clearDisplay(); oled.setFont(&FreeSerif9pt7b); oled.setTextSize(1); oled.setTextColor(WHITE); oled.setCursor(0, 14); // Y = baseline oled.println(F("FreeSerif 9pt")); oled.setCursor(0, 38); oled.println(F("DIYables OLED")); oled.setCursor(0, 58); oled.println(F("Hello World!")); oled.display(); delay(3000); // ── FreeSansBold 12pt ── oled.clearDisplay(); oled.setFont(&FreeSansBold12pt7b); oled.setTextSize(1); oled.setTextColor(WHITE); oled.setCursor(0, 20); oled.println(F("SansBold")); oled.setCursor(0, 52); oled.println(F("DIYables")); oled.display(); delay(3000); // ── FreeMono 9pt ── oled.clearDisplay(); oled.setFont(&FreeMono9pt7b); oled.setTextSize(1); oled.setTextColor(WHITE); oled.setCursor(0, 14); oled.println(F("FreeMono 9pt")); oled.setCursor(0, 34); oled.println(F("0123456789")); oled.setCursor(0, 54); oled.println(F("!@#$%^&*()")); oled.display(); delay(3000); }

    Schnelle Schritte

    • Kopieren Sie den Code oben und fügen Sie ihn in sketch/sketch.ino ein.
    • Klicken Sie in Arduino App Lab auf die Schaltfläche Ausführen.
    Klicken Sie in Arduino App Lab auf Arduino UNO Q auf die Schaltfläche Ausführen

    Das OLED wechselt durch die integrierte Schriftart, FreeSerif 9pt, FreeSansBold 12pt und FreeMono 9pt.

    Linux + MCU Bridge-Programmierung

    Das Arduino UNO Q hat zwei Prozessoren, die zusammenarbeiten: die MPU (Qualcomm, führt Debian Linux aus) und die MCU (STM32, führt Zephyr OS mit Ihrer Arduino-Skizze aus). Sie kommunizieren über RPC über die Arduino_RouterBridge-Bibliothek — niemals über rohe serielle Anschlüsse.

    • Das OLED ist mit der MCU (STM32) verbunden — über I2C (SCL/SDA). Nur die MCU kann es direkt steuern.
    • Die MPU kann das OLED nicht direkt steuern — sie ruft Bridge.call("display_text", "text") auf der MCU auf, die das Display aktualisiert und das Ergebnis zum Monitor druckt.
    • Die MPU hat Wi-Fi — da die MPU vollständiges Debian Linux mit Wi-Fi ausführt, kann sie Telegram-Befehle empfangen und jede Nachricht remote auf dem OLED anzeigen.
    • Kommunikation: Bridge.call() auf der Linux-Seite ruft Bridge.provide_safe()-Funktionen auf der MCU-Seite auf (da OLED-Display-Schreibvorgänge Hardware-API-Aufrufe sind).
    • ⚠️ Reserviert: /dev/ttyHS1 (Linux) und Serial1 (MCU) werden vom Arduino Router verwendet — öffnen Sie sie niemals direkt.

    Kurz: MPU sendet Text über Bridge → MCU aktualisiert OLED → MCU druckt Ergebnis zum Monitor.

    MCU-Skizze — OLED 128x64 mit Bridge und Monitor-Ausgabe:

    /* * Dieser Arduino UNO Q Code wurde von newbiely.de entwickelt * Dieser Arduino UNO Q Code wird der Öffentlichkeit ohne jegliche Einschränkung zur Verfügung gestellt. * Für vollständige Anleitungen und Schaltpläne besuchen Sie bitte: * https://newbiely.de/tutorials/arduino-uno-q/arduino-uno-q-oled-128x64 */ #include "Arduino_RouterBridge.h" #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); String current_text = ""; void display_text(String text) { current_text = text; oled.clearDisplay(); oled.setTextSize(1); oled.setTextColor(WHITE); oled.setCursor(0, 0); oled.println(text); oled.display(); Monitor.println("OLED: " + text); } void clear_oled() { current_text = ""; oled.clearDisplay(); oled.display(); Monitor.println("OLED cleared"); } void get_status() { Monitor.println("Text: " + current_text); } void setup() { Bridge.begin(); Monitor.begin(); if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Monitor.println("OLED init failed"); while (true); } delay(1000); oled.clearDisplay(); oled.setTextSize(1); oled.setTextColor(WHITE); oled.setCursor(0, 0); oled.println("Bridge Ready"); oled.display(); Bridge.provide_safe("display_text", display_text); Bridge.provide_safe("clear_oled", clear_oled); Bridge.provide("get_status", get_status); Monitor.println("OLED 128x64 Bridge ready"); } void loop() {}

    Python-Skript (Arduino App Lab) — Text auf OLED von Linux anzeigen:

    /* * Dieser Arduino UNO Q Code wurde von newbiely.de entwickelt * Dieser Arduino UNO Q Code wird der Öffentlichkeit ohne jegliche Einschränkung zur Verfügung gestellt. * Für vollständige Anleitungen und Schaltpläne besuchen Sie bitte: * https://newbiely.de/tutorials/arduino-uno-q/arduino-uno-q-oled-128x64 */ from arduino.app_utils import * import time def loop(): result = Bridge.call("display_text", "Hello UNO Q\nOLED 128x64\nPython Bridge") print(result) time.sleep(3) result = Bridge.call("clear_oled") print(result) time.sleep(1) result = Bridge.call("display_text", "DIYables.io") print(result) time.sleep(3) App.run(user_loop=loop)

    Schnelle Schritte

    • Neue App erstellen: Öffnen Sie Arduino App Lab, klicken Sie auf Neue App erstellen, benennen Sie sie DIYables_OLED_128x64_Bridge, und klicken Sie auf Erstellen.
    • MCU-Skizze einfügen: Kopieren Sie den Bridge MCU-Code oben und fügen Sie ihn in sketch/sketch.ino ein.
    • Python-Skript einfügen: Kopieren Sie den Python-Code oben und fügen Sie ihn in die Python-Datei in der App ein.
    • App ausführen: Klicken Sie auf die Schaltfläche Ausführen — die Python-Seite wechselt durch Nachrichten auf dem OLED.

    App Lab-Konsolenausgabe

    DIYables_Apps
    Stop
    sketch.ino
    1#include "Arduino_RouterBridge.h"
    Serial Monitor
    Python
    Message (Enter to send a message to "Newbiely" on usb(2820070321))
    New Line
    9600 baud
    OLED 128x64 Bridge ready OLED: Hello UNO Q OLED cleared OLED: DIYables.io

    Telegram-Integration

    Zeigen Sie beliebigen Text remote von überall über Telegram auf Ihrem OLED an.

    Wenn Sie noch keinen Telegram-Bot haben, lesen Sie How to Create a Telegram Bot, um Ihr Bot-Token zu erhalten, bevor Sie fortfahren.

    MCU-Skizze: Behalten Sie die gleiche MCU-Skizze aus dem vorherigen Bridge-Abschnitt — keine Änderungen erforderlich. Stellen Sie sicher, dass sie bereits auf die STM32 hochgeladen und dort ausgeführt wird, bevor Sie fortfahren.

    Python-Skript (Arduino App Lab) — Telegram-Bot für OLED 128x64:

    /* * Dieser Arduino UNO Q Code wurde von newbiely.de entwickelt * Dieser Arduino UNO Q Code wird der Öffentlichkeit ohne jegliche Einschränkung zur Verfügung gestellt. * Für vollständige Anleitungen und Schaltpläne besuchen Sie bitte: * https://newbiely.de/tutorials/arduino-uno-q/arduino-uno-q-oled-128x64 */ from arduino.app_utils import * import requests import time BOT_TOKEN = "YOUR_BOT_TOKEN" API_URL = f"https://api.telegram.org/bot{BOT_TOKEN}" last_update_id = 0 def send_message(chat_id, text): requests.post(f"{API_URL}/sendMessage", json={"chat_id": chat_id, "text": text}) def get_updates(): global last_update_id resp = requests.get(f"{API_URL}/getUpdates", params={"offset": last_update_id + 1, "timeout": 5}) return resp.json().get("result", []) def loop(): global last_update_id updates = get_updates() for update in updates: last_update_id = update["update_id"] msg = update.get("message", {}) chat_id = msg.get("chat", {}).get("id") text = msg.get("text", "").strip() if text.startswith("/display "): content = text[9:] result = Bridge.call("display_text", content) print(f"[Telegram] /display: {content}") send_message(chat_id, result) elif text == "/clear": result = Bridge.call("clear_oled") print(f"[Telegram] /clear") send_message(chat_id, result) elif text == "/status": result = Bridge.call("get_status") print(f"[Telegram] /status: {result}") send_message(chat_id, result) else: send_message(chat_id, "Commands:\n/display <text> — show text on OLED\n/clear — clear the OLED\n/status — show current OLED content") App.run(user_loop=loop)
    • Hinweis: Ersetzen Sie YOUR_BOT_TOKEN durch das Token, das Sie von @BotFather auf Telegram erhalten haben.
    • Senden Sie /display Hallo Welt — der Text erscheint auf dem OLED.
    • Senden Sie /clear — der OLED-Bildschirm wird gelöscht.
    • Senden Sie /status — der Bot antwortet mit dem aktuellen OLED-Inhalt.

    Schnelle Schritte

    • MCU-Skizze hochladen: Verwenden Sie die Bridge-MCU-Skizze aus dem vorherigen Abschnitt.
    • Telegram-Skript einfügen: Kopieren Sie den Python-Code oben in die Python-Registerkarte.
    • Ihr Token einstellen: Ersetzen Sie YOUR_BOT_TOKEN durch Ihr tatsächliches Bot-Token.
    • App ausführen: Klicken Sie auf Ausführen — der Bot beginnt, auf Telegram-Befehle zu lauschen.
    • Testen Sie es: Senden Sie /display Arduino UNO Q — der Text sollte auf dem OLED erscheinen.

    App Lab-Konsolenausgabe

    DIYables_Apps
    Stop
    sketch.ino
    1#include "Arduino_RouterBridge.h"
    Serial Monitor
    Python
    [2026-04-29 12:00:01] Telegram: /display Arduino UNO Q [2026-04-29 12:00:01] OLED: Arduino UNO Q [2026-04-29 12:05:10] Telegram: /status [2026-04-29 12:05:10] Text: Arduino UNO Q [2026-04-29 12:10:20] Telegram: /clear [2026-04-29 12:10:20] OLED cleared
    Telegram
    Telegram 12:45
    Welcome to Telegram!
    ArduinoBot 10:19
    Chatting with Arduino...
    telegram-botfather
    BotFather Yesterday
    Your bot has been created.

    ArduinoBot

    bot
    Today
    /display Arduino UNO Q
    10:15 AM ✓✓
    OLED: Arduino UNO Q
    10:16 AM
    /status
    10:17 AM ✓✓
    Text: Arduino UNO Q
    10:18 AM
    /clear
    10:19 AM ✓✓
    OLED cleared
    10:20 AM

    OpenClaw-Integration

    Sie können den OpenClaw an dieses Tutorial anpassen, indem Sie sich auf die Anleitung im Tutorial Arduino Uno Q - OpenClaw beziehen

    Anwendungs-/Projektideen

    • Kompakte Sensoranzeige: Zeigen Sie Temperatur-, Feuchtigkeits- oder Entfernungswerte in kleinem Formfaktor für tragbare oder eingebettete Projekte an
    • Remote-Statusboard: Übertragen Sie Warnmeldungen über Telegram an das OLED, wenn ein Sensorschwellenwert überschritten wird
    • Wi-Fi-Signalstärkemesser: Zeigen Sie die Wi-Fi-Signalstärke der MPU und den Namen des verbundenen Netzwerks auf dem OLED an
    • Stoppuhr / Timer: Verwenden Sie das OLED, um einen millisekunden-genauen Timer anzuzeigen, der über Telegram-Start-/Stoppbefehle gesteuert wird
    • Benutzerdefinierte Symbolan zeige: Zeichnen Sie ein Batteriesymbol oder Signalbalken auf dem OLED mit drawRect, fillRect und drawBitmap

    Stellen Sie sich selbst auf die Probe

    • Leicht: Ändern Sie den Telegram-Bot so, dass er /big <text> unterstützt, das Text in Schriftgröße 2 (größere Zeichen) anzeigt
    • Mittel: Fügen Sie Zentrierung hinzu: Berechnen Sie (SCREEN_WIDTH - textWidth) / 2 und verwenden Sie dies als x-Cursorposition
    • Fortgeschritten: Zeigen Sie eine Echtzeituhr auf dem OLED an — rufen Sie die aktuelle Zeit über die Linux-Uhr der MPU über Bridge ab und aktualisieren Sie jede Sekunde

    ※ UNSERE NACHRICHTEN

    • Sie können gerne den Link zu diesem Tutorial teilen. Bitte verwenden Sie jedoch unsere Inhalte nicht auf anderen Websites. Wir haben viel Mühe und Zeit in die Erstellung der Inhalte investiert, bitte respektieren Sie unsere Arbeit!