Use keyword args for echo & trigger in DistanceSensor example

This commit is contained in:
Ben Nuttall
2016-06-03 16:37:11 +01:00
parent 2587612403
commit 4db57cd0ac

View File

@@ -534,7 +534,7 @@ class DistanceSensor(SmoothedInputDevice):
from gpiozero import DistanceSensor
from time import sleep
sensor = DistanceSensor(18, 17)
sensor = DistanceSensor(echo=18, trigger=17)
while True:
print('Distance: ', sensor.distance * 100)
sleep(1)