epaper_hello_world.ino

Kit de ensamblaje M5Stack PaperDIY (ESP32-S3) · Archivo : epaper_hello_world.ino · Lenguaje : C++ · Uso : Afficher un texte simple sur l'écran e-paper ED047TC1.

Inicializa la pantalla e-paper y muestra un mensaje de bienvenida.

Utiliza la biblioteca GxEPD2. Configura los pines CS, DC, RST y BUSY según el esquema PaperDIY. Compila para el objetivo ESP32-S3.

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);
}

← Volver a la ficha