from machine import Pin
from time import sleep
pir=Pin(0,Pin.IN)
led=Pin(1,Pin.OUT)
def Led():
led.on()
sleep(0.2)
led.off()
sleep(0.1)
while True:
Status=pir.value()
if Status==1:
print("Motion is detected")
Led()
else:
print("Motion is not detected")
led.off
sleep(0.04)