I have a Arduino Uno connected to a ST-VL53L1X-SATEL which works fine with the Pololu library.
When running the examples I get fine results.
However, I’m trying to do two things with it, both without succes.
One is more difficult, I want to count people with the sensor, but honestly, don’t know where to start.
The more easy one, I think, is I would like to make a trigger event at a certain distance.
For instance; If the sensor is in a normal situation (room with nobody in it) it’s senses a distance of 1.75m,
The LED should go off. if it senses a distance of 1.25m or less the LED should turn on, if it senses a distance of less then a meter, the LED should start blink.
Does anyone have experience with this or know how to achieve this? Here is the code so far, be aware, this is just the example of Pololu, I did not changed anything.
This example shows how to take simple range measurements with the VL53L1X. The
range readings are in units of mm.
Serial.println(“Failed to detect and initialize sensor!”);
// Use long distance mode and allow up to 50000 us (50 ms) for a measurement.
// You can change these settings to adjust the performance of the sensor, but
// the minimum timing budget is 20 ms for short distance mode and 33 ms for
// medium and long distance modes. See the VL53L1X datasheet for more
// information on range and timing limits.
// Start continuous readings at a rate of one measurement every 50 ms (the
// inter-measurement period). This period should be at least as long as the
// timing budget.