from machine import Pin
import time
# PIR Sensor connected to GPIO 26
pir = Pin(10, Pin.IN)
while True:
if pir.value():
print("Motion Detected!")
else:
print("No Motion")
time.sleep(1) # 1-second delay
from machine import Pin
import time
# PIR Sensor connected to GPIO 26
pir = Pin(10, Pin.IN)
while True:
if pir.value():
print("Motion Detected!")
else:
print("No Motion")
time.sleep(1) # 1-second delay