2021-10-07 12:33:20 +02:00
|
|
|
from peoplecounter import PeopleCounter
|
|
|
|
from sensor.vl53l1xsensor import VL53L1XSensor
|
|
|
|
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
|
|
|
|
logging.info(f'People count change to: {peopleCount}')
|
|
|
|
|
|
|
|
|
|
|
|
counter.hookCounting(countChange)
|
|
|
|
counter.run()
|