Deepsleep wake only on rising pin?
Posted: Mon Jan 17, 2022 11:07 pm
I have two pins on an ESP32 that are often held high. How do I have them only wake the device when it's rising and not already held? The device won't stay in deep sleep when it's held high.
It's a door sensor. When the door is open I send an alert then deep sleep until the close sensor is detected.
Relevant code:
It's a door sensor. When the door is open I send an alert then deep sleep until the close sensor is detected.
Relevant code:
Code: Select all
door_open_pin = machine.Pin(DOOR_OPEN_PIN, machine.Pin.IN, machine.Pin.PULL_DOWN)
door_close_pin = machine.Pin(DOOR_CLOSE_PIN, machine.Pin.IN, machine.Pin.PULL_DOWN)
esp32.wake_on_ext1(
pins=(door_open_pin, door_close_pin),
level=esp32.WAKEUP_ANY_HIGH)