from machine import Pin
from hcsr04 import hcsr04
Ir=Pin(19,Pin.OUT)
Io=Pin(4,Pin.OUT)
Iv=Pin(2,Pin.OUT)
cap=HCSR04(trigger_pin=5,echo_=18,evho_timeout_us1000000)
while true:
if d>=40:
Iv.on()
Io.off()
Ir.off()
elif d>150:
Io.on
Iv.off
Ir.off