Closed microbit-carlos closed 1 year ago
Not 100% sure if it's the same issue, but a programme without the ms
argument and with button A and run_every
as wake sources, and it looks like power.deep_sleep()
also blocks until the run_every
function runs.
So, with this programme, when I press button A soon after the board has woken up (it shows the surprised face), it will wake up, show the surprise face, and stay there until the next time run_every
is fired (which can be tracked via serial print()
), only then it will finally scroll "text".
from microbit import *
import power
@run_every(s=10)
def log_temperature():
print(running_time())
display.show(Image.SURPRISED)
while True:
if button_a.was_pressed():
display.scroll("text")
display.show(Image.SURPRISED)
power.deep_sleep(wake_on=button_a, run_every=True)
This has been updated in PR:
Looks like it will be an extra argument with a flag:
The CODAL next tag hasn't been release yet, so for the moment this is a placeholder issue for when it can be integrated.