from machine import pin 
import utime
trigger = Pin (15,Pin.OUT)
echo = Pin (14,Pin.IN)

while true:
    trigger.low()
    utime.sleep_us(2)
    trigger.high()
    utime.sleep_us(5)
    while echio.value()==0;
    signal off = utime.ticks_us()
    while echo.value()==1;
    signalon = utime.ticks_us()
    timepassed = signalon-signaloff
    distance = (timepassed* 0.0343)/2
    print ("Total distance",distance","cm")

    utime.sleep(1)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT