RP2350 lightsleep broken on battery #18731
Replies: 1 comment
-
|
@chhu, I think the problem may be in your code. When I wrap that snippet in in an `while True:' loop, so that there is actually a loop to continue, it works just fine. # main.py
from machine import Pin
import machine
import time
led = Pin("LED", Pin.OUT) # Use the built-in LED
while True:
led.off()
print("LED OFF")
time.sleep(1)
led.on()
print("LED ON")
time.sleep(1)
machine.lightsleep(10_000)
print(f"Woke up from lightsleep at {time.ticks_ms()} ms\n"
"reason: {machine.reset_cause()}"
)With a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Port, board and/or hardware
pico 2 w
MicroPython version
v1.27.0 (2025-12-09)
Reproduction
from machine import Pin
import machine
import time
led = Pin("LED", Pin.OUT) # Use the built-in LED
just to indicate when a reset occured
led.off()
time.sleep(1)
led.on()
time.sleep(1)
machine.lightsleep(60_000)
Expected behaviour
LED should go out for 1s every 62s.
Observed behaviour
Keeps blinking in 1s intervals when on battery power (Vsys), disconnected USB. WLAN off.
Additional Information
Same behavior with deepsleep. My work-around is
now = time.time()
wake = now + 60
while now < wake:
machine.lightsleep(60_000)
now = time.time()
but goal was to save power. With this loop it is idling at 0.15W versus 0.2W with time.sleep. Bummer. Is this a limitation of the pico 2 w?
Thanks!
Code of Conduct
Yes, I agree
Beta Was this translation helpful? Give feedback.
All reactions