I am very new to working with Arduino and any kind of circuits.
I am trying to set up an ESP32 board to wake up with an external trigger by using the command `esp_sleep_enable_ext0_wakeup`
- void setup(){
- int MY_PIN = 13;
- pinMode(MY_PIN, INPUT_PULLUP);
- int reading = digitalRead(MY_PIN);
- if(reading == 1) {
- esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,0);
- }
- else {
- esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,1);
- }
- // I want the board to wake up every time the state of the switch changes.
- esp_deep_sleep_start();
- }
Is there a way to use the internal pull-up resistor for this purpose?
I would appreciate anyone who could explain how this works in general.
The documentation[1] says:
Maybe I need to configure it correctly with `esp_sleep_pd_config`. Could that be the reason for the pullup resistor not working?@note This function does not modify pin configuration. The pin is configured in esp_sleep_start, immediately before entering sleep mode.
https://github.com/espressif/arduino-es ... sp_sleep.h