m5paper_button_led_basic.ino
Basic example to initialize the M5EPD library and display dynamic data on the e-Ink screen.
This code uses the standard M5EPD library. It configures the IT8951 display and shows a counter. Although the M5Paper has no visible external LEDs, the screen serves as the output interface. The physical button (if present on the kit) or touch can be read via m5.touchGetRaw() functions.
m5paper_button_led_basic.ino
#include <M5EPD.h>
M5EPD m5;
void setup() {
m5.begin();
Serial.begin(115200);
Serial.println("M5Paper GPIO Test");
// Initialiser les LED (si disponibles sur la version spécifique, sinon utiliser l'écran)
// Note: Le M5Paper n'a pas de LED externe standard comme le Core,
// mais on utilise l'écran pour le feedback visuel simple.
m5.updateFrame();
}
void loop() {
// Lire les boutons tactiles virtuels ou physiques si câblés
// Ici, simulation par changement de couleur d'écran selon un compteur
static int count = 0;
count++;
// Effacer l'écran
m5.clear();
// Afficher un texte simple
m5.drawCentreString("GPIO Test: " + String(count), 480, 270, 4);
// Mettre à jour l'écran e-Ink (partiel pour vitesse)
m5.updateFrame();
delay(1000);
}