from machine import Pin
import time
# Define PIR sensor pin (adjust if you use a different one)
pir = Pin(15, Pin.IN)
print("PIR Module Test (press Ctrl+C to stop)")
try:
while True:
if pir.value():
print("Motion detected!")
else:
print("No motion")
time.sleep(1)
except KeyboardInterrupt:
print("Program stopped")