Adjust thresholds
This commit is contained in:
parent
ef20bf5367
commit
9a99a1f8a6
6
main.py
6
main.py
|
@ -61,12 +61,12 @@ class Marshaller(Server):
|
|||
|
||||
if distance_in_inches < 15:
|
||||
self.red_led.on()
|
||||
elif distance_in_inches < 20:
|
||||
elif distance_in_inches < 23:
|
||||
self.green_led.on()
|
||||
self.yellow_led.on()
|
||||
elif distance_in_inches < 25:
|
||||
self.green_led.on()
|
||||
elif distance_in_inches < 30:
|
||||
elif distance_in_inches < 33:
|
||||
self.yellow_led.on()
|
||||
else:
|
||||
self.blue_led.on()
|
||||
|
@ -80,7 +80,7 @@ class Marshaller(Server):
|
|||
def get_buffered_distance_in_inches(self):
|
||||
distance = self.get_distance_in_inches()
|
||||
|
||||
if abs(distance - self.last_value) > 0.5:
|
||||
if abs(distance - self.last_value) > 0.25:
|
||||
self.last_value = distance
|
||||
|
||||
return self.last_value
|
||||
|
|
Loading…
Reference in New Issue