from machine import Pin
import time
b0=Pin(9,Pin.IN)
led1=Pin(6,Pin.OUT)
led2=Pin(7,Pin.OUT)
while True:
motion=b0.value()
print("Motion:",motion)
if motion==0:
print("No motion.")
led1.value(1)
led2.value(0)
else:
print("Motion detected!")
led1.value(0)
led2.value(1)
time.sleep(0.1)