from machine import Pin
import time
pir = Pin(16, Pin.IN) # Connect OUT of PIR to GP16
print("PIR Sensor Test Starting...")
while True:
if pir.value():
print("Motion Detected!")
else:
print("No Motion")
time.sleep(1)from machine import Pin
import time
pir = Pin(16, Pin.IN) # Connect OUT of PIR to GP16
print("PIR Sensor Test Starting...")
while True:
if pir.value():
print("Motion Detected!")
else:
print("No Motion")
time.sleep(1)