Added deep sleep after work done

This commit is contained in:
Blue Fox 2022-08-21 21:25:13 +02:00
parent 03dec075d1
commit 0f36538ec0

View File

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