This results in numeric overflow, what is the maximum sleep time that can be set using this method ??
Code: Select all
sleepsec = 3600 ## 1 HR
sleepus = sleepsec * 1000000
esp.deepsleep(sleepus)
Code: Select all
sleepsec = 3600 ## 1 HR
sleepus = sleepsec * 1000000
esp.deepsleep(sleepus)
Code: Select all
rtc = RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
# check if the device woke from a deep sleep
if machine.reset_cause() == machine.DEEPSLEEP_RESET:
print('woke from a deep sleep')
# set RTC.ALARM0 to fire after 60 mins (waking the device)
rtc.alarm(rtc.ALARM0, 1000*60*60)
# put the device to sleep
machine.deepsleep()