from machine import Pin
import time

pir_sensor = Pin(28, Pin.IN)  
led = Pin(1, Pin.OUT)        

while True:
    if pir_sensor.value() == 1:  
        led.on()                  
        print("Motion detected! LED ON.")
    else:
        led.off()                 
        print("No motion. LED OFF.")
    
    time.sleep(0.1)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT