#u python script to interface IR sensor with ESP32
from machine import Pin
from time import sleep
led= Pin(2, Pin.OUT)
buzzer= Pin(21, Pin.OUT)
sensor= Pin(34, Pin.IN)
while True:
if(sensor.value()==1):
led.value(1)
buzzer.value(1)
print("Motion Detected")
else:
led.value(0)
buzzer.value(0)
print("Motion Not Detected")
sleep(0.5)