from machine import Pin
import time
pir = Pin(15, Pin.IN)
led = Pin (8, Pin.OUT)
while True:
if pir.value ()== 1:
print("movimiento detectado")
led.on ()
time.sleep(1)
else:
print("sin detección")
led.off ()
time.sleep(1)