from machine import Pin
from time import sleep
pir_pin = Pin(14, Pin.IN)
buzzer_pin = Pin(12, Pin.OUT)
led_pin = Pin(13, Pin.OUT)
while True:
if pir_pin.value() == 1:
print("Motion detected!")
buzzer_pin.value(1)
led_pin.value(1)
sleep(5)
buzzer_pin.value(0)
led_pin.value(0)
print('Motion Stopped')
sleep(0.5)