-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
CircuitPython version and board name
Adafruit CircuitPython 10.0.3 on 2025-10-17; Pimoroni Badger 2040 with rp2040Code/REPL
# something I tried...
# INACTIVITY TIMEOUT (Only on battery)
if time.monotonic() - last_activity > INACTIVITY_TIMEOUT:
_, is_charging = get_battery_status()
if is_charging:
print("On USB power - staying awake")
last_activity = time.monotonic()
else:
print(f"DEBUG: Inactivity timeout. Saving state. Current Page: {current}")
for btn in buttons.values():
btn.deinit()
button_pins = [
board.SW_UP,
board.SW_DOWN,
board.SW_A,
board.SW_B,
board.SW_C
]
pin_alarms = [
alarm.pin.PinAlarm(pin=pin, value=True, edge=True, pull=False)
for pin in button_pins
]
print("Entering deep sleep. Press any button to wake...")
alarm.exit_and_deep_sleep_until_alarms(*pin_alarms)Behavior
Maybe not a bug, but a feature request?
The Badger2040 has a display.halt() command that puts the display to sleep (removes power from the eink display) and sets the rp2040 in deep sleep where it supposedly draws less then 1 ma. It can then be woken by a button press (any button), which resets the CPU and reloads main.py.
Is there a way to achieve this with Circuitpython? I tried some things with alarms and trying to maintain pins to the correct voltage so they can wake the device, but all failed.
I found this source code that looks like it might be something to do with the firmware? Not too sure. Here it is anyway : https://github.com/pimoroni/badger2040/blob/main/firmware/modules/wakeup/wakeup.cpp
Am I missing something? How do I achieve this?
Any help appreciated!
Description
No response
Additional information
No response