from machine import Pin, time_pulse_us
import utime

trig = Pin(15,Pin.OUT)
ech = Pin(14,Pin.IN)

while True:
    trig.value(1)
    utime.sleep_us(10)
    trig.value(0)
    time = time_pulse_us(ech,1)
    dist = (time*0.0343)/2
    print("distancia {:.2f} cm".format(dist))
    utime.sleep(1)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT