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
{{ message }}
Repository navigation
lightsleep(n) returns immediately on pico-w or pico with network imported #17204
MicroPython v1.25.0 on 2025-04-15; Raspberry Pi Pico W with RP2040
Reproduction
copy paste this code:
# light_sleep_test.py
from machine import lightsleep
from time import sleep_ms, ticks_ms, ticks_diff
def test(n):
for i in range(n):
t0 = ticks_ms()
sleep_ms(50)
lightsleep(5000)
sleep_ms(50)
print(i, ticks_diff(ticks_ms(), t0))
test(10)
Expected behaviour
If the test works it should print
0 5101
1 5101
2 5101
3 5101
4 5101
5 5101
6 5101
7 5100
8 5101
9 5100
Activity
cpottle9 commentedon Apr 30, 2025
I am pretty sure this is the same issue as 16181.
I did a quick test in 1.24.1 and I see the problem their too.
phdussud commentedon Apr 30, 2025
I think this is correct. The proposed solution outlined in 16181 makes sense to me.