from machine import Pin
import time
pir=Pin(15,Pin.IN)
led=Pin(14,Pin.OUT)
buzzer=Pin(13,Pin.OUT)
print("PIR motion sensor test running..")
while True:
if pir.value()==1:
print ("Motion detected")
led.value(1)
buzzer.value(1)
time.sleep(5)
else:
led.value(0)
buzzer.value(0)
time.sleep(0.1)