#include <GxEPD2_BW.h>
#include <Adafruit_GFX.h>
// --- Fonts ---
#include <Fonts/FreeSerifBold12pt7b.h>
#include <Fonts/FreeMonoBold9pt7b.h>
// --- Shared SPI pins ---
// GPIO6 -> DIN (MOSI)
// GPIO4 -> CLK (SCK)
// --- 2.9" E-Paper via UGB2 ---
// VCC -> 3V3
// GND -> GND
// DIN -> GPIO6 (MOSI)
// CLK -> GPIO4 (SCK)
// CS -> GPIO7
// DC -> GPIO5
// RST -> GPIO8
// BUSY -> GPIO9
// --- 2.13" E-Paper Module ---
// VCC -> 3V3
// GND -> GND
// DIN -> GPIO6 (MOSI)
// CLK -> GPIO4 (SCK)
// CS -> GPIO10
// DC -> GPIO11
// RST -> GPIO12
// BUSY -> GPIO13
// Define both displays
GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT> display29(
GxEPD2_290(/*CS=*/7, /*DC=*/5, /*RST=*/8, /*BUSY=*/9)
);
GxEPD2_BW<GxEPD2_213_B73, GxEPD2_213_B73::HEIGHT> display213(
GxEPD2_213_B73(/*CS=*/10, /*DC=*/11, /*RST=*/12, /*BUSY=*/13)
);
// Quotes array
const char* quotes[] = {
"Stay curious.",
"Small steps, big dreams.",
"Light tomorrow with today.",
"Simplicity is sophistication.",
"Begin anywhere."
};
const int numQuotes = sizeof(quotes) / sizeof(quotes[0]);
void setup() {
static int bootCount = 0;
bootCount++;
int quoteIndex = bootCount % numQuotes;
// Init both displays
display29.init();
display213.init();
// --- 2.9" Display (Inspirational Quote) ---
display29.setRotation(1);
display29.setFont(&FreeSerifBold12pt7b);
display29.setTextColor(GxEPD_BLACK);
display29.firstPage();
do {
display29.fillScreen(GxEPD_WHITE);
display29.setCursor(20, 70);
display29.print(quotes[quoteIndex]);
} while (display29.nextPage());
// --- 2.13" Display (Checklist) ---
display213.setRotation(0);
display213.setFont(&FreeMonoBold9pt7b);
display213.setTextColor(GxEPD_BLACK);
display213.firstPage();
do {
display213.fillScreen(GxEPD_WHITE);
display213.setCursor(10, 20);
display213.print("TODAY");
display213.setCursor(10, 50);
display213.print("[x] Buy Groceries");
display213.setCursor(10, 70);
display213.print("[ ] Call John");
} while (display213.nextPage());
}
void loop() {}
Loading
xiao-esp32-c3
xiao-esp32-c3