#Use the PIR sensor to detect a movemnet
#VCC of PIR to 3.3V Pico
#GND of PIR to GND Pico
#D Pin of PIR to pin 16 Pico
#modules
from machine import Pin
from time import sleep
#create the pir object, IN
pir = Pin(16, Pin.IN)
#continous read from the sensor
#print a message if a movemnet was detected
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 a movement to be detected!")
#check for a movement every second
sleep(1)