diff --git a/examples/T-Block/Epaper_Badge/Epaper_Badge.ino b/examples/T-Block/Epaper_Badge/Epaper_Badge.ino index bf37c32..a65a04e 100644 --- a/examples/T-Block/Epaper_Badge/Epaper_Badge.ino +++ b/examples/T-Block/Epaper_Badge/Epaper_Badge.ino @@ -515,6 +515,7 @@ void drawBitmap(const char *filename, int16_t x, int16_t y, bool with_color) } } +static bool page = false; void setup() { @@ -536,8 +537,10 @@ void setup() twatch->begin(); +#ifdef LILYGO_WATCH_HAS_BACKLIGHT // Turn on the backlight twatch->openBL(); +#endif rtc = twatch->rtc; @@ -569,7 +572,6 @@ void setup() btn->setPressedHandler([]() { - static bool page = false; if (!page) { showQrPage(); } else { @@ -578,8 +580,10 @@ void setup() page = !page; }); +#ifdef LILYGO_WATCH_HAS_BACKLIGHT // Adjust the backlight to reduce current consumption twatch->setBrightness(DEFAULT_BRIGHTNESS); +#endif if (!loadBadgeInfo(&info)) { loadDefaultInfo(); @@ -594,12 +598,24 @@ void setup() void loop() { +#ifdef LILYGO_WATCH_HAS_TOUCH + if (twatch->touched()) { + if (!page) { + showQrPage(); + } else { + showMianPage(); + } + page = !page; + } +#endif if (pwIRQ) { pwIRQ = false; // Get interrupt status power->readIRQ(); if (power->isPEKShortPressIRQ()) { +#ifdef LILYGO_WATCH_HAS_BACKLIGHT twatch->bl->isOn() ? twatch->bl->off() : twatch->bl->adjust(DEFAULT_BRIGHTNESS); +#endif } // After the interruption, you need to manually clear the interruption status power->clearIRQ(); diff --git a/examples/T-Block/Epaper_Badge/config.h b/examples/T-Block/Epaper_Badge/config.h index e527b32..0077ed8 100644 --- a/examples/T-Block/Epaper_Badge/config.h +++ b/examples/T-Block/Epaper_Badge/config.h @@ -10,7 +10,7 @@ // => Function select #define LILYGO_EINK_GDEH0154D67_BL //It is electronic paper with backlight // #define LILYGO_EINK_GDEH0154D67_TP //It is electronic paper with touchscreen - +// #define LILYGO_EINK_GDEP015OC1 //Single electronic paper, no backlight, no touch #include