Quick MicroPython experiments with code, embedded simulators, and source links.
š§² 1. Wokwi Debounce Demo
This project uses MicroPython to debounce a pushbutton and toggle an LED ā ideal for learning interrupts and hardware signal smoothing.
š® Live Demo (click + edit):
š§ MicroPython Code:
from machine import Pin
from time import sleep
led = Pin(2, Pin.OUT)
btn = Pin(4, Pin.IN, Pin.PULL_UP)
while True:
if not btn.value():
led.value(not led.value())
sleep(0.3) # debounce delay