#include <GxEPD2_BW.h>
#include <Adafruit_GFX.h>
// ==================================================
// ESP32 DevKit + 2.9" E-Paper 296x128
// ==================================================
#define EPD_CS 5
#define EPD_DC 17
#define EPD_RST 16
#define EPD_BUSY 4
// Common 2.9" 296x128 Waveshare panel
GxEPD2_BW<GxEPD2_290_T5,
GxEPD2_290_T5::HEIGHT> display(
GxEPD2_290_T5(
EPD_CS,
EPD_DC,
EPD_RST,
EPD_BUSY
)
);
// ==================================================
// Draw To-Do Checklist
// ==================================================
void drawChecklist()
{
display.setFullWindow();
display.firstPage();
do
{
// White background
display.fillScreen(GxEPD_WHITE);
display.setTextColor(GxEPD_BLACK);
display.setFont(NULL);
// -----------------------------------------------
// TITLE
// -----------------------------------------------
display.setTextSize(2);
display.setCursor(108, 20);
display.print("TODAY");
// Title line
display.drawLine(85, 27, 210, 27, GxEPD_BLACK);
// -----------------------------------------------
// 1. MORNING WALK - CHECKED
// -----------------------------------------------
display.drawRect(12, 34, 17, 17, GxEPD_BLACK);
// Check mark
display.drawLine(15, 42, 20, 47, GxEPD_BLACK);
display.drawLine(20, 47, 27, 37, GxEPD_BLACK);
display.setTextSize(1);
display.setCursor(38, 47);
display.print("Morning Walk");
display.drawLine(8, 55, 288, 55, GxEPD_BLACK);
// -----------------------------------------------
// 2. READ BOOK - CHECKED
// -----------------------------------------------
display.drawRect(12, 61, 17, 17, GxEPD_BLACK);
display.drawLine(15, 69, 20, 74, GxEPD_BLACK);
display.drawLine(20, 74, 27, 64, GxEPD_BLACK);
display.setCursor(38, 74);
display.print("Read Book");
display.drawLine(8, 82, 288, 82, GxEPD_BLACK);
// -----------------------------------------------
// 3. WORK ON PROJECT
// -----------------------------------------------
display.drawRect(12, 88, 17, 17, GxEPD_BLACK);
display.setCursor(38, 101);
display.print("Work on Project");
display.drawLine(8, 109, 288, 109, GxEPD_BLACK);
// -----------------------------------------------
// 4. CALL MOM
// -----------------------------------------------
display.drawRect(12, 115, 17, 17, GxEPD_BLACK);
display.setCursor(38, 128);
display.print("Call Mom");
}
while (display.nextPage());
}
// ==================================================
// SETUP
// ==================================================
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println("ESP32 + 2.9 inch E-Paper");
Serial.println("To-Do Checklist");
display.init(115200);
// Landscape
display.setRotation(1);
drawChecklist();
Serial.println("Checklist displayed.");
}
// ==================================================
// LOOP
// ==================================================
void loop()
{
// E-paper retains the image.
// No continuous refresh required.
delay(1000);
}Loading
epaper-2in9
epaper-2in9