# Step 1: import libraries
from machine import Pin
import time
#Step 2: configure I/O pin
PIR_sensor = Pin(15, Pin.IN, Pin.PULL_DOWN)
led = Pin(0, Pin.OUT)
time.sleep(1)
while True:
print(PIR_sensor.value())
if PIR_sensor.value() == 1:
print("Motion detected")
led.high()