mash-sensor-tof-pc/src/console_counter.py

19 lines
413 B
Python
Raw Normal View History

2022-09-14 00:15:37 +02:00
from sensors.people_counter import PeopleCounter
from sensors.vl53l1x_sensor import VL53L1XSensor
2021-10-07 12:33:20 +02:00
import logging
counter = PeopleCounter(VL53L1XSensor())
peopleCount = 0
2021-10-07 14:04:07 +02:00
logging.getLogger().setLevel(logging.INFO)
2021-10-07 12:33:20 +02:00
def countChange(change: int) -> None:
global peopleCount
peopleCount += change
2022-09-14 00:15:37 +02:00
logging.info(f"People count change to: {peopleCount}")
2021-10-07 12:33:20 +02:00
counter.hookCounting(countChange)
counter.run()