Added simple test-measuring script

This commit is contained in:
Maximilian Giller 2023-10-09 18:10:13 +02:00
parent 4cb7e3f731
commit 91a8700b8e

23
src/measurer.py Normal file
View file

@ -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)