from machine import Pin
from time import sleep_us
from machine import time_pulse_us
Trig= Pin(1, Pin.OUT)
Echo= Pin(0, Pin.IN)
while True:
Trig.value(0)
sleep_us(2)
Trig.value(1)
sleep_us(10)
Trig.value(0)
tempo= time_pulse_us(Echo, 1, 20000)
distancia= tempo / 58
print("Distancia:",round(distancia, 0), "cm")