@ScruffR I’m using your library you have here with zero problems : https://build.particle.io/build/584f095f31c7319f1d001284
I never saw a timeout message serial print.
Using your Library I’m using the exact code below with great results inside the house. Background Christmas lights do cause random readings, but pointed at a wall it’s solid.
I also took it outside today while a good amount of snow was falling and it would measure or get thrown off as it measured snowflakes that fell in the laser beams path. So you would have to be careful when placing one of these outside to avoid readings being triggered by snow or rain particles.
Here is the exact code I’m running on a Photon with 0.6.0 firmware using your library.
/* This example shows how to use continuous mode to take
range measurements with the VL53L0X. It is based on
vl53l0x_ContinuousRanging_Example.c from the VL53L0X API.
The range readings are in units of mm. */
# include "VL53L0X/VL53L0X.h"
# include "VL53L0X.h"
# include <Wire.h>
// Uncomment ONE of these two lines to get
// - higher speed at the cost of lower accuracy OR
// - higher accuracy at the cost of lower speed
#if defined LONG_RANGE
// lower the return signal rate limit (default is 0.25 MCPS)
// increase laser pulse periods (defaults are 14 and 10 PCLKs)
#if defined HIGH_SPEED
// reduce timing budget to 20 ms (default is about 33 ms)
#elif defined HIGH_ACCURACY
// increase timing budget to 200 ms
sensor.setMeasurementTimingBudget(100000); //This default setting was 200000 before I lowered it to 100000 FYI. The lower the number the more samples per second.
int distancemm = sensor.readRangeSingleMillimeters();
if (distancemm >= 9000) //Change 9000 to the maximum distance you want to get readings from. Only readings below this number will serial print.
// action A
The sensor I have would max out at 8198 or something in the 8000+ range. If the laser is pointing at something further away then 6.5 feet the reading would return a steady 8195 - 8194. Not sure why yours is showing 20,000+?
I think we have access to the Interrupt threshold setting in your working library but I’m not sure how to activate it. I did see the interrupt registers in the .h file code as shown in the screen shot below: