1

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?

Rick Yoder
  • 11
  • 1

1 Answers1

0

It should work fine. I have code that sends an MQTT message every 6 hours. If an alarm goes off it wakes up and sends that alarm. Here is my code watchible It does just what you wants. I have also tested the sleep mode and it draws very little current.

CrabbyPete
  • 121
  • 4