Hi all,
I'm looking for some help with my ESP32-S3-Dev (n16p8) board, and the Waveshare 7.5 Eink display.
The display driver hat, is a waveshare rev2.3
The Waveshare 7.5 has: 075BN-T7-D2 on the back of it.
I'm using the GxEPD library, and trying the simple example of "HelloWorld".
I'm using this display driver: GxEPD2_750_T7, which I believe is for my eink display.
The default pins for the HelloWorld example don't match my board, for example I don't have a pin 23 for MOSI, but I've used these pins:
And have defined them in my constructor:
// Define your custom SPI and control pins
#define EPD_CS 10
#define EPD_DC 9
#define EPD_RST 8
#define EPD_BUSY 18
#define EPD_MOSI 11
#define EPD_SCK 12
// GxEPD2 display constructor (uses global SPI object)
GxEPD2_BW<GxEPD2_750_T7, GxEPD2_750_T7::HEIGHT> display(GxEPD2_750_T7(EPD_CS, EPD_DC, EPD_RST, EPD_BUSY));
The issue is, the screen clears and briefly shows the word: "HelloWorld" but then disappears.
This is the entire example of the sketch I'm using:
#include <SPI.h>
#include <GxEPD2_BW.h>
#include <Fonts/FreeMonoBold9pt7b.h>
// Define your custom SPI and control pins
#define EPD_CS 10
#define EPD_DC 9
#define EPD_RST 8
#define EPD_BUSY 18
#define EPD_MOSI 11
#define EPD_SCK 12
// GxEPD2 display constructor (uses global SPI object)
GxEPD2_BW<GxEPD2_750_T7, GxEPD2_750_T7::HEIGHT> display(GxEPD2_750_T7(EPD_CS, EPD_DC, EPD_RST, EPD_BUSY));
const char HelloWorld[] = "Hello World!";
void waitForBusy(const char* message)
{
Serial.print("Waiting for BUSY LOW - ");
Serial.println(message);
int lastState = digitalRead(EPD_BUSY);
while (digitalRead(EPD_BUSY) == HIGH)
{
int currentState = digitalRead(EPD_BUSY);
if (currentState != lastState) {
Serial.print("BUSY pin changed to: ");
Serial.println(currentState == HIGH ? "HIGH (Busy)" : "LOW (Idle)");
lastState = currentState;
} else {
Serial.print("."); // print a dot for each delay cycle
}
delay(100);
}
Serial.println("\nBUSY LOW detected, proceeding.");
}
void setup()
{
Serial.begin(115200);
delay(500); // Give serial some time to initialize
// Initialize global SPI object with custom pins
SPI.begin(EPD_SCK, -1, EPD_MOSI, -1); // SCK, MISO (not used), MOSI
// Configure BUSY pin as input (redundant but safe)
pinMode(EPD_BUSY, INPUT);
Serial.println("Initializing display...");
display.init(115200, true, 2, false);
waitForBusy("after init");
helloWorld();
waitForBusy("after drawing");
Serial.println("Putting display to hibernate...");
display.hibernate();
waitForBusy("after hibernate");
Serial.println("Display hibernated.");
}
void helloWorld()
{
display.setRotation(1);
display.setFont(&FreeMonoBold9pt7b);
display.setTextColor(GxEPD_BLACK);
int16_t tbx, tby;
uint16_t tbw, tbh;
display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
// Center text
uint16_t x = ((display.width() - tbw) / 2) - tbx;
uint16_t y = ((display.height() - tbh) / 2) - tby;
display.setFullWindow();
display.firstPage();
do
{
display.fillScreen(GxEPD_WHITE);
display.setCursor(x, y);
display.print(HelloWorld);
}
while (display.nextPage());
Serial.println("Hello World displayed.");
}
void loop() {}
Can someone please guide as to where I'm going wrong