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