Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
8 lines (6 sloc) 177 Bytes
from gpiozero import DistanceSensor
from time import sleep
sensor = DistanceSensor(echo=18, trigger=17)
while True:
print('Distance: ', sensor.distance * 100)
sleep(1)