Improved defaults

This commit is contained in:
Maximilian Giller 2023-10-09 19:11:33 +02:00
parent e7d397563a
commit 63509438b0
2 changed files with 3 additions and 3 deletions

View file

@ -13,10 +13,10 @@ END_DISTANCE = "end_distance"
class PeopleCounter:
def __init__(self, sensor: ToFSensor) -> None:
def __init__(self, sensor: ToFSensor, maxTriggerDistanceInCm: int = 90) -> None:
self.sensor = sensor
self.callbacks = {COUNTING_CB: [], TRIGGER_CB: [], CHANGE_CB: []}
self.maxTriggerDistance = 120 # In cm
self.maxTriggerDistance = maxTriggerDistanceInCm
def hookCounting(self, cb) -> None:
self.callbacks[COUNTING_CB].append(cb)

View file

@ -22,7 +22,7 @@ class VL53L1XSensor(ToFSensor):
def __init__(self) -> None:
super().__init__()
def open(self, ranging_mode: int = 2) -> None:
def open(self, ranging_mode: int = 3) -> None:
self.sensor = VL53L1X.VL53L1X(i2c_bus=1, i2c_address=0x29)
self.sensor.open()
self.roi = VL53L1X.VL53L1xUserRoi()