From 0f36538ec0d0cea3046db9ede02e2374e22ca53e Mon Sep 17 00:00:00 2001 From: Blue Fox Date: Sun, 21 Aug 2022 21:25:13 +0200 Subject: [PATCH] Added deep sleep after work done --- losungepaper.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/losungepaper.ino b/losungepaper.ino index 0f0f3c9..96ec5e5 100755 --- a/losungepaper.ino +++ b/losungepaper.ino @@ -6,6 +6,7 @@ #define UNCOLORED 1 Epd epd; +int DEEP_SLEEP_TIME_uS = 6 * 60 * 60 * 1000 * 1000; // time to deep sleep in microseconds (not milliseconds!) // WiFi char wiFiSSID[] = "SSID"; // SSID of your network @@ -41,6 +42,11 @@ void setup() { String html = getHTML(); showDailyText(getLosungFromHTML(html), getLehrtextFromHTML(html), getLosungSourceFromHTML(html), getLehrtextSourceFromHTML(html)); + + // deep sleep for 6 hours + esp_sleep_enable_timer_wakeup(DEEP_SLEEP_TIME_uS); + Serial.printf("[ESP32] Going to deep sleep mode.\n"); + esp_deep_sleep_start(); } void loop() {