Skip to content
Discussion options

You must be logged in to vote

Wasn't so difficult after all:

import esp32
from machine import Pin, lightsleep
import utime


wake_source = Pin(27, Pin.IN) #  setting wake up pin, has a 10K to ground
esp32.wake_on_ext0(pin = wake_source, level = esp32.WAKEUP_ANY_HIGH)


print ('waiting for 5 seconds to allow a CTRL-C')
utime.sleep(5)

while True:

    if (wake_source.value() == 1):
        print ('we got a valid trigger')
        utime.sleep(0.1)

     #  do the processing you want

 #  feed the watchdog(s)

    print ('going to lightsleep for 60 seconds')
    utime.sleep(0.1)

    lightsleep(60000)

BTW, it looks RTC.irq() is not in v1.19.1

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@scruss
Comment options

Answer selected by davefes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants