You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
362 B
Python

4 years ago
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)