Demonstrates periodic LED blinking using hardware timers instead of software delays.
This allows the Pico to multitask while the LED toggles automatically.
| Component | Pico Pin | Description |
|---|---|---|
| LED | GPIO16 | Output |
| GND | GND | Ground |
The machine.Timer module triggers a callback at fixed intervals.
Here, it toggles the LED every 1 second (period=1000 ms).
- Open Thonny IDE
- Copy this code to your Pico W as
main.py - The LED blinks once per second without using
sleep()
- Change blink rate by adjusting
period - Use two timers to blink two LEDs asynchronously
- Combine with sensors for event-based feedback