diff --git a/src/measurer.py b/src/measurer.py new file mode 100644 index 0000000..ecb535b --- /dev/null +++ b/src/measurer.py @@ -0,0 +1,23 @@ +from src.sensors.tof_sensor import Directions +from sensors.vl53l1x_sensor import VL53L1XSensor +from time import sleep +import logging + + +DELAY_SECONDS = 1 + + +sensor = VL53L1XSensor() + +while True: + sensor.setDirection(Directions.INSIDE) + distance_inside = sensor.getDistance() + + sensor.setDirection(Directions.OUTSIDE) + distance_outside = sensor.getDistance() + + logging.info(f"----------\nInside: {distance_inside} cm") + logging.info(f"Outside: {distance_outside} cm") + + sleep(DELAY_SECONDS) +