This project demonstrates using hardware interrupts on the Raspberry Pi Pico W to toggle the on-board LED when a push button is pressed.
- Raspberry Pi Pico / Pico W
- Thonny IDE
- MicroPython Firmware
| Component | Pin | Description |
|---|---|---|
| LED | On-board | GPIO 25 |
| Push Button | GP16 | Input with Pull-up |
- The button press triggers a falling-edge interrupt.
- The interrupt service routine toggles the LED.
- Debounce delay ensures stable operation.
- Uses
irq()method for interrupt handling. - Simple debounce using
time.sleep(). - Fully compatible with Pico and Pico W.