from machine import PWM,Pin
from time import sleep
from hcsr04 import HCSR04
ultrasonic = HCSR04(trigger_pin=13, echo_pin=12, echo_timeout_us=1000000)
i=0
led = Pin(2,Pin.OUT)
led2 = Pin(4,Pin.OUT)
led3 = Pin(5,Pin.OUT)
while True:
i+=1
sleep(2)
distance = ultrasonic.distance_cm()
print('Distance:', distance, 'cm')
if:
distance = ultrasonic.distance_cm()
elif: