from machine import Pin
from time import sleep
led= Pin(2,Pin,Out)
Sensor= Pin(34,Pin.IN)
while True:
if(Sensor,value ()==i):
led.value(1)
print("Motion detected")
else:
led.value(0)
print("Motion Not Detected")
sleep(0.5)