1#include <WiFiClientSecure.h>
8 pinMode(
SD_EN, OUTPUT);
34 digitalWrite(
EPD_EN, HIGH);
45 digitalWrite(
SD_EN, LOW);
46 if (!SD.begin(
SD_CS)) {
47 Serial.println(
"SD failed!");
57 digitalWrite(
SD_EN, HIGH);
77 esp_sleep_enable_timer_wakeup(sleep_time_us);
78 Serial.printf(
"Timer wakeup after %lld microseconds...", sleep_time_us);
81 esp_deep_sleep_start();
91 esp_sleep_enable_ext0_wakeup((gpio_num_t)gpio_num, 0);
92 Serial.printf(
"Button wakeup on pin %d", gpio_num);
94 esp_deep_sleep_start();
104 esp_sleep_enable_timer_wakeup(sleep_time_us);
105 esp_sleep_enable_ext0_wakeup((gpio_num_t)gpio_num, 0);
106 Serial.printf(
"Timer wakeup after %lld us or button on pin %d", sleep_time_us, gpio_num);
108 esp_deep_sleep_start();
115 WiFi.begin(ssid, password);
117 while (WiFi.status() != WL_CONNECTED) {
123 Serial.println(
"Connected");
int8_t disable_everything()
int8_t deep_sleep_timer_wakeup(uint64_t sleep_time_us)
virtual int8_t enable_display()
virtual int8_t disable_display()
int8_t connect_wifi(const char *ssid, const char *password, uint8_t attempts)
int8_t deep_sleep_button_wakeup(uint8_t gpio_num)
int8_t deep_sleep_timer_button_wakeup(uint64_t sleep_time_us, uint8_t gpio_num)