#include <SPI.h>
#include <GxEPD2_BW.h>
#include <Adafruit_GFX.h>
#include <Fonts/FreeMonoBold12pt7b.h>
#define EPD_CS 7
#define EPD_DC 3
#define EPD_RST 2
#define EPD_BUSY 1
// Wokwi 2.9" monochrome e-paper
GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT>
display(GxEPD2_290(EPD_CS, EPD_DC, EPD_RST, EPD_BUSY));
void setup() {
Serial.begin(115200);
// Our actual wiring:
// SCK -> GPIO4
// MOSI -> GPIO6
// MISO unused
// CS -> GPIO7
SPI.begin(4, -1, 6, EPD_CS);
display.init(115200);
display.setRotation(1);
display.setFullWindow();
display.firstPage();
do {
display.fillScreen(GxEPD_WHITE);
display.setTextColor(GxEPD_BLACK);
display.setFont(&FreeMonoBold12pt7b);
display.setCursor(20, 60);
display.print("Hello e-paper");
// Obvious graphics test too
display.drawRect(10, 80, 200, 30, GxEPD_BLACK);
display.drawLine(10, 110, 210, 80, GxEPD_BLACK);
} while (display.nextPage());
Serial.println("Display test complete");
}
void loop() {
}Loading
epaper-2in9
epaper-2in9