from machine import Pin #improting module to get pin module
from time import sleep #importing module to get sleep function
led = Pin(14, Pin.OUT)
sensor = Pin(15, Pin.IN)
while True:
if (sensor.value() == 1):
led.value(1)
print("Motion is there")
else:
led.value(0)
print("Motion not found")
sleep(1)