Added simple test-measuring script
This commit is contained in:
parent
4cb7e3f731
commit
91a8700b8e
1 changed files with 23 additions and 0 deletions
23
src/measurer.py
Normal file
23
src/measurer.py
Normal 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)
|
||||||
|
|
Loading…
Reference in a new issue