#include <GxEPD2_BW.h>
#include <Adafruit_GFX.h>
// Pin definitions
#define SCK 18
#define DIN 23
#define CS 5
#define RST 4
#define DC 2
#define BUSY 15
// Initialize the display
GxEPD2_BW<GxEPD2_213_B72, GxEPD2_213_B72::HEIGHT> display(GxEPD2_213_B72(CS, DC, RST, BUSY));
void setup() {
// Start serial communication for debugging purposes
Serial.begin(115200);
Serial.println("Starting...");
// Initialize the display
display.init(115200); // Add baud rate for SPI
display.setRotation(1); // Set rotation if needed, 0, 1, 2, 3
// Debugging: check if display is busy
if (display.epd2.panel == GxEPD2::GDEH0213B72) {
Serial.println("Display model: GDEH0213B72");
} else {
Serial.println("Unknown display model!");
}
// Clear the display buffer
display.setFullWindow();
display.firstPage();
do {
display.fillScreen(GxEPD_WHITE); // Clear display
display.setCursor(20, 60); // Set cursor position
display.setTextColor(GxEPD_BLACK);// Set text color
display.setTextSize(2); // Set text size
display.print("Hello, World!"); // Print text
} while (display.nextPage());
Serial.println("Done!");
}
void loop() {
// Nothing to do here
}
Loading
epaper-2in9
epaper-2in9