Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1247

Python • MicroPython: How to wake Pi Pico / Pico W / Pico 2 from sleep using GPIO button?

$
0
0
A lot of people use sleep modes for finite amount of times, waking up after X seconds.

I would like to indefinitely make the microcontroller go to sleep until any of 4 GPIO buttons is pressed.

I can't seem to find a rudimentary example of this. I found some stuff related to other microcontroller boards (ESP32), but the code did not work for the Pico.

Do I use Pin.irq? What arguments should I be using?

Is the code different depending on the sleep state? Light vs deep? What are the differences?

Statistics: Posted by RYoder97 — Tue Nov 05, 2024 8:46 pm



Viewing all articles
Browse latest Browse all 1247

Trending Articles