from machine import Pin
from time import sleep
motion=Pin(6,Pin.IN)
Led=Pin(13,Pin.OUT)

while True:
    val=motion.value()
    print(motion.value())
    sleep(2)
    if val==1:
        Led.value(1)
    else:
        Led.value(0)