from machine import Pin
import time
led=Pin(4, Pin.OUT)
pir=Pin(13, Pin.IN, Pin.PULL_DOWN)
while True:
if pir.value():
print("Movimiento detectado")
led.on()
time.sleep(1)
else:
print("No hay movimiento")
led.off()
time.sleep(1)