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() {