from machine import Pin
from time import sleep
pir = Pin(16, Pin.IN)
while True:
if pir.value() == 1:
print(f"PIR value: {pir.value()} Status: Motion detected!")
else:
print(f"PIR value: {pir.value()} Status: Waiting for movement...")
sleep(1)