Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import time
|
|
import board
|
|
import digitalio
|
|
|
|
print("press the button!")
|
|
|
|
led = digitalio.DigitalInOut(board.D18)
|
|
led.direction = digitalio.Direction.OUTPUT
|
|
|
|
button = digitalio.DigitalInOut(board.D4)
|
|
button.direction = digitalio.Direction.INPUT
|
|
button.pull = digitalio.Pull.UP
|
|
|
|
while True:
|
|
led.value = not button.value # light when button is pressed!
|