from machine import Pin
import time
# Configure the PIR sensor
pir_sensor = Pin(23, Pin.IN)
while True:
if pir_sensor.value():
print("Motion detected!")
else:
print("No motion.")
time.sleep(1)
from machine import Pin
import time
# Configure the PIR sensor
pir_sensor = Pin(23, Pin.IN)
while True:
if pir_sensor.value():
print("Motion detected!")
else:
print("No motion.")
time.sleep(1)