Why use Serial.println() to configure sleep mode?
Posted: Mon Oct 14, 2019 3:35 am
I'm developing some code that I want to put into deep sleep. According to what I've read, the configuration instruction should be as follows:
In my application RTC_IN is the pin through which I feed a signal from an external RTC which I'll use to awaken the ESP32.
My code compiles, though I haven't tried to run it yet. Why is the configuration instruction supposed to be placed inside a Serial.println() statement? Especially since the command to go to sleep is not placed in a Serial.println(), as expected:
Why not just use:
Which also compiles, btw.
Also, which pins can be used to trigger the wake-up? Thanks for any tips?
Code: Select all
Serial.println(esp_deep_sleep_enable_ext0_wakeup((gpio_num_t)RTC_IN, 0)); // 1 = active high, 0 = active low.
My code compiles, though I haven't tried to run it yet. Why is the configuration instruction supposed to be placed inside a Serial.println() statement? Especially since the command to go to sleep is not placed in a Serial.println(), as expected:
Code: Select all
esp_deep_sleep_start();
Code: Select all
esp_deep_sleep_enable_ext0_wakeup((gpio_num_t)RTC_IN, 0); // 1 = active high, 0 = active low.
Also, which pins can be used to trigger the wake-up? Thanks for any tips?