Raspberry Pi Pico practice problem · Raspberry Pi Pico
Two-way switch
EasyBudget $6MicroPython
A red LED on GP13 is lit first. Each press of the button on GP12 swaps the lights: red goes off and green (GP16) comes on, and the next press swaps back.
Debounce: wait 20 ms after a press and read again before acting.