Raspberry Pi Pico practice problem · Raspberry Pi Pico
Press to toggle
MediumBudget $4MicroPython
One button on GP12, one LED on GP13. Each press flips the LED; holding the button does not flip it again.
Real contacts bounce for a few milliseconds, so a press can look like several. After you see a press, wait 20 ms and check again before counting it.