from machine import Pin
import time
ir_sensor = Pin(14, Pin.IN)
led = Pin(2, Pin.OUT)
buzzer = Pin(15, Pin.OUT)
while True:
if(ir_sensor.value() == 1):
led.on()
buzzer.on()
print("Motion Detected")
else:
led.off()
buzzer.off()
print("Motion not detected")
time.sleep(1)