from hcsr04 import hscr04
from time import sleep
sensor = HCSR04(trigger_pin=15,echo_pin=4)
while True :
distance = sensor.distance_cm
print("khoảng cách: ", distance, " cm")
sleep(0.1)
from hcsr04 import hscr04
from time import sleep
sensor = HCSR04(trigger_pin=15,echo_pin=4)
while True :
distance = sensor.distance_cm
print("khoảng cách: ", distance, " cm")
sleep(0.1)