from machine import Pin
from time import sleep
pir = Pin(4,Pin.IN)
led = Pin(5,Pin.OUT)
while True:
if pir.value()==1:
led.value(1)
print("Motuion is detected")
sleep(1)
led.value(0)
else:
print("Motion is not detected")
led.value(0)
sleep(1)