epaper_hello_world.ino

M5Stack PaperDIY Assembly Kit (ESP32-S3) · File : epaper_hello_world.ino · Language : C++ · Use case : Afficher un texte simple sur l'écran e-paper ED047TC1.

Initializes the e-paper display and shows a welcome message.

Uses the GxEPD2 library. Configure CS, DC, RST, and BUSY pins according to the PaperDIY schematic. Compile for the ESP32-S3 target.

epaper_hello_world.ino

#include <Arduino.h>
#include <GxEPD2_BW.h>
#include <GxEPD2_3C.h>
#include <Fonts/FreeMonoBold9pt7b.h>

// Configuration spécifique pour M5Paper / PaperDIY (ED047TC1)
// Interface parallèle 8 bits sur les GPIOs spécifiques du M5Stack
GxEPD2_BW<GxEPD2_47_EPD, GxEPD2_47_EPD::HEIGHT> display(GxEPD2_47_EPD(/*CS*/ 5, /*DC*/ 12, /*RST*/ 15, /*BUSY*/ 39));

void setup() {
  Serial.begin(115200);
  display.init(115200);
  display.setRotation(0); // 0=Portrait, 1=Landscape
  display.setFont(&FreeMonoBold9pt7b);
  display.setTextColor(GXEPD_BLACK);
  display.setTextSize(2);
}

void loop() {
  display.clearDisplay();
  display.setCursor(20, 40);
  display.print("Hello M5Stack PaperDIY!");
  display.setCursor(20, 80);
  display.print("ESP32-S3 + E-Paper");
  display.display();
  delay(5000);
}

← Back to the board