Wakeup
#include <M5CoreS3.h>
void setup(void) {
auto cfg = M5.config();
CoreS3.begin(cfg);
CoreS3.Display.setTextColor(GREEN);
CoreS3.Display.setTextDatum(middle_center);
CoreS3.Display.setFont(&fonts::FreeSerifItalic18pt7b);
CoreS3.Display.setTextSize(1);
CoreS3.Display.drawString("Touch", CoreS3.Display.width() / 2,
CoreS3.Display.height() / 2 - 60);
CoreS3.Display.drawString("to sleep", CoreS3.Display.width() / 2,
CoreS3.Display.height() / 2 - 20);
CoreS3.Display.drawString("After 5s", CoreS3.Display.width() / 2,
CoreS3.Display.height() / 2 + 20);
CoreS3.Display.drawString("Wakeup", CoreS3.Display.width() / 2,
CoreS3.Display.height() / 2 + 60);
}
void loop(void) {
CoreS3.update();
if (CoreS3.Touch.getCount() && CoreS3.Touch.getDetail(0).wasClicked()) {
CoreS3.Power.timerSleep(5);
}
}