Sketch 10x DIY Button Prototype Sketches. 5 must be toggle, 5 must be momentary. All should be handmade with cardboard (or other similar prototyping substrate), conductive tape, and other common materials.
'''
button_led.py
toggle between two LEDs via button press
'''
from machine import Pin
from time import sleep_ms
button = Pin(12, Pin.IN, Pin.PULL_UP)
led1 = Pin(27, Pin.OUT)
led2 = Pin(33, Pin.OUT)
while True:
if not button.value():
print("LED1 IS ON, LED2 IS OFF")
led1.v...
'''
button.py
'''
from machine import Pin
from time import sleep_msx...