# Buoc 1: Import thu vien, khai bao chan tin hieu IO
from machine import Pin
import time
# Khai bao led la chan tin hieu ra
led = Pin(14, Pin.OUT)
# Cam bien la chan tin hieu vao
sensor = Pin(12, Pin.IN)
while True:
value = sensor.value()
if(value == 1):
led.on()
else:
led.off()
time.sleep(5)