from machine import Pin
button_1 = Pin(15, Pin.IN, Pin.PULL_UP)
led_1 = Pin(14, Pin.OUT, Pin.PULL_UP)
def is_button_pressed(pin):
# TODO: Replace below implementation with
# button debouncing
return pin.value() == 0
while True:
if is_button_pressed(button_1):
led_1.toggle()