Hello,
anyone have a Rust Code that work with Waveshare E-INK Display 1.54" V2
( Jumper 4 Line )
Got only this:
Wireing:
Using: XIAO ESP32S3 + Wio-SX1262
| Panel pin | XIAO pin | GPIO | Notes |
|---|---|---|---|
| VCC | 3V3 | — | 3.3 V only |
| GND | GND | — | |
| DIN | D10 / MOSI | 9 | shared with the radio |
| CLK | D8 / SCK | 7 | shared with the radio |
| CS | D1 | 2 | |
| DC | D2 | 3 | |
| RST | D3 | 4 | |
| BUSY | D4 | 5 | |
The Display works, got a ARDUINO Code
that do a Demo and this works.
But wanna use RUST
/*
* E-Ink Diagnose mit GxEPD2 (v6)
* Seeed XIAO ESP32-S3 + Waveshare 1.54" e-Paper V2 (200x200, UC8151)
*
* VORHER INSTALLIEREN (Bibliotheks-Manager, "Werkzeuge -> Bibliotheken verwalten"):
* - "GxEPD2" (von Jean-Marc Zingg)
* - "Adafruit GFX Library" (wird von GxEPD2 benoetigt)
*
* Verkabelung (XIAO ESP32-S3):
* VCC -> 3V3
* GND -> GND
* DIN -> D10 (GPIO9, MOSI)
* CLK -> D9 (GPIO8, SCK)
* CS -> D1 (GPIO2)
* DC -> D2 (GPIO3)
* RST -> D3 (GPIO4)
* BUSY -> D4 (GPIO5)
*/
#include <GxEPD2_BW.h>
#include <Fonts/FreeMonoBold12pt7b.h>
// Waveshare 1.54" V2 (200x200) = GxEPD2_154_D67
GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(
GxEPD2_154_D67(/*CS=*/2, /*DC=*/3, /*RST=*/4, /*BUSY=*/5));
void setup() {
Serial.begin(115200);
delay(2000);
Serial.println("\n=== GxEPD2-Test: XIAO ESP32-S3 + Waveshare 1.54\" V2 ===");
// WICHTIG: SPI-Pins explizit setzen, BEVOR display.init() selbst
// SPI.begin() mit Default-Pins aufrufen wuerde (SCK=D9/GPIO8, MOSI=D10/GPIO9)!
SPI.begin(/*SCK=*/8, /*MISO=*/-1, /*MOSI=*/9, /*SS=*/2);
display.init(115200, true, 2, false); // serielle Diagnose von GxEPD2 aktivieren!
// ---- Test 1: Text ----
Serial.println("Test 1: Text");
display.setRotation(0);
display.setFont(&FreeMonoBold12pt7b);
display.setTextColor(GxEPD_BLACK);
display.setFullWindow();
display.firstPage();
do {
display.fillScreen(GxEPD_WHITE);
display.setCursor(15, 40);
display.print("E-Ink OK");
display.setCursor(15, 90);
display.print("XIAO S3");
} while (display.nextPage());
delay(4000);
// ---- Test 2: Alles schwarz ----
Serial.println("Test 2: Alles schwarz");
display.firstPage();
do { display.fillScreen(GxEPD_BLACK); } while (display.nextPage());
delay(4000);
// ---- Test 3: Schachbrett ----
Serial.println("Test 3: Schachbrett");
display.firstPage();
do {
display.fillScreen(GxEPD_WHITE);
for (int y = 0; y < display.height(); y += 25)
for (int x = 0; x < display.width(); x += 25)
if (((x / 25) + (y / 25)) % 2 == 0)
display.fillRect(x, y, 25, 25, GxEPD_BLACK);
} while (display.nextPage());
delay(4000);
// ---- Test 4: Rahmen ----
Serial.println("Test 4: Rahmen");
display.firstPage();
do {
display.fillScreen(GxEPD_WHITE);
display.drawRect(5, 5, display.width() - 10, display.height() - 10, GxEPD_BLACK);
display.drawLine(0, 0, display.width(), display.height(), GxEPD_BLACK);
display.drawLine(display.width(), 0, 0, display.height(), GxEPD_BLACK);
} while (display.nextPage());
Serial.println("\nFERTIG. Wenn KEIN Test sichtbar war, obwohl der serielle");
Serial.println("Monitor die Tests durchlaeuft, ist das Display-Modul sehr");
Serial.println("wahrscheinlich defekt (Panel oder FPC-Verbindung).");
display.hibernate();
}
void loop() {}
