In the book on Raspberry Pico with micropyhton there is no mention to deep sleep. Can you suggest anything? I have found not much in the web on this. Thanks, Luiz
Hi.
We decided to not include deep sleep in the eBook, because at the time, many people were complaining that it didn’t work.
There’s this piece of information at the documentation if you want to try it:
https://docs.micropython.org/en/v1.16/rp2/quickref.html#deep-sleep-mode
I didn’t have the opportunity to test it yet.
If you test it, let me know your results.
Regards,
Sara
It worked turning on-off the onboard led (see code below), adding the command “deepsleep(10000)”. Doing this, the code remains stopped during this time, 10 s. Measuring the current, it goes from 35 mA to 12 mA in deep sleep. But, when the wifi is on, it does not work. The current does not reduce and the time does not change.
from machine import Pin, deepsleep
import time
import machine
led = machine.Pin(“LED”, machine.Pin.OUT)
def blink(t):
i=0
while True:
led.toggle()
time.sleep(0.3)
i+=1
if i == t: break
while True:
blink(10)
deepsleep(10000)