Skip to content

Commit bcef471

Browse files
authored
Merge pull request #123 from KihtrakRaknas/patch-1
Make max_distance in DistanceSensor a float
2 parents d63def7 + 5426fe9 commit bcef471

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

picozero/picozero.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ class DistanceSensor(PinsMixin):
19031903
close to measure) and 1 (maximum distance). This parameter specifies
19041904
the maximum distance expected in meters. This defaults to 1.
19051905
"""
1906-
def __init__(self, echo, trigger, max_distance=1):
1906+
def __init__(self, echo, trigger, max_distance=1.0):
19071907
self._pin_nums = (echo, trigger)
19081908
self._max_distance = max_distance
19091909
self._echo = Pin(echo, mode=Pin.IN, pull=Pin.PULL_DOWN)

0 commit comments

Comments
 (0)