Hi all,
trying to set up deep sleep ext1 but on the Sparkfun hook up page it does not give the RTC pins on the diagram. Guide is very basic and would expect more details on it
thanks peeps
Hi all,
trying to set up deep sleep ext1 but on the Sparkfun hook up page it does not give the RTC pins on the diagram. Guide is very basic and would expect more details on it
thanks peeps
That’s covered in the esp32 datasheet
But, here’s some stuff to note:
#include <esp_sleep.h>
void setup() {
Serial.begin(115200);
// Configure RTC GPIO (e.g., GPIO39 and GPIO36) as wake-up sources
esp_sleep_enable_ext1_wakeup(((uint64_t)1 << 39) | ((uint64_t)1 << 36), ESP_EXT1_WAKEUP_ANY_HIGH);
Serial.println("Going to sleep now");
esp_deep_sleep_start();
}
void loop() {
// This will never be reached
}
This example uses GPIO 36 and 39 as wake-up pins.
The SparkFun ESP32 Thing Plus board may not explicitly label which pins are RTC GPIOs, but you can refer to the ESP32 datasheet or pinout diagrams to identify them.
When using ext1 wake-up, remember that only RTC peripherals are powered during deep sleep, so you may need to reinitialize other peripherals after waking up