from machine import Pin
from time import sleep
led=Pin(2,Pin.OUT)
Sensor=Pin(34,Pin.IN)
while True:
if (Sensor.value ()==1):
led.value(1)
print("motion detected")
else:
led.value(0)
print("motion not detected")
sleep(0.5)