import board import digitalio import time led = digitalio.DigitalInOut(board.D13) led.switch_to_output() button_a = digitalio.DigitalInOut(board.D4) button_a.switch_to_input(pull=digitalio.Pull.DOWN) while True: # if button_a.value: # led.value = True # else: # led.value = False led.value = not button_a.value time.sleep(0.01)