Hi,
Is there another way to wake up PyBoard in stop or standby mode?
import pyb
rtc = pyb.RTC()
rtc.wakeup(1000) # wakeup every 1000 ms (1 second)
while True:
do_some_processing()
pyb.stop()
Thank you
Wake up PyBoard
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: Wake up PyBoard
In standby mode, the only way to wake pyboard is reset. In stop mode, you may use RTC or pin level irq to wake it.
Code: Select all
def pin1_irq(t):
#do something
return
pin1 = Pin(Pin('B0'), Pin.IN)
pin1.irq(handler=pin1_irq, trigger=Pin.IRQ_FALLING)
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Wake up PyBoard
Yes. For ways to wake from standby and more information on building low power systems I suggest you look at this repo. Standby has the characteristic that program state is lost: it behaves similarly to a soft reset. This limits its application areas.
Waking from stop is much more versatile, because program state can be retained while stopped. My fork of uasyncio here provides a module which enables any asynchronous application to stop for a period and resume where it left off. There is a demo lpdemo.py which waits for a button press with low power consumption, retaining program state.
Waking from stop is much more versatile, because program state can be retained while stopped. My fork of uasyncio here provides a module which enables any asynchronous application to stop for a period and resume where it left off. There is a demo lpdemo.py which waits for a button press with low power consumption, retaining program state.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.