# kiểm tra trạng thái nút nhấn
# in trạng thái ra màn hình
# nút nhấn ko đc lấp vào D2, D34, D35
# khi nút ko nhấn 1, nút đc nhấn 0
from machine import Pin
from time import sleep
button = Pin(19, Pin.In, Pin.PULL_UP)
led = Pin(2, Pin.OUT)
while True:
buttonStatus = button.value()
print(buttonStatus)
sleep(0.1)
if buttonStatus == 0:
led.value(1)
esle:
led.value(0)