You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can confirm the same behavior on Pico W (RP2040) with latest Micropython stable release (v1.24.0).
I have slightly modified this example to:
# Lightsleep MicroPython example.
from machine import Pin
import machine
import time
led = Pin('LED', Pin.OUT)
while True:
for _ in range(5):
led.toggle()
time.sleep_ms(200)
time.sleep(1)
machine.lightsleep(5000)
On older Micropython Releases (v1.22.0 & v1.23.0) the above code has an expected delay of 6 seconds between the short pulses.
Using the latest Micropython Release (v1.24.0), the same code has only a 1 second delay between the short pulses - the lightsleep instruction is "ignored".
Sidenote:
When replacing machine.lightsleep with machine.deepsleep, there is also only a 1 second delay after the short pulses. Then the pico will reset. This can be observed as for the longer 1 second delay the LED is always "on".
Port, board and/or hardware
Pico 2 / RP2350
MicroPython version
MicroPython v1.24.0-preview.201.g269a0e0e1 on 2024-08-09; Raspberry Pi Pico2 with RP2350
Reproduction
machine.lightsleep(5000)
in your codeExpected behaviour
Expected Pico 2 to enter
lightsleep
mode for 5 seconds, then continue to next bit of code.Observed behaviour
lightsleep
is maybe entered for a cycle or so, but code carries on and never stops executing for any time value I enter forlightsleep
.Additional Information
Complete code example:
Code of Conduct
Yes, I agree
The text was updated successfully, but these errors were encountered: