HIGH_SPEED with VL53L0X?

Hello nathanb,

thanks for answering!
I also tried the continuous measurement mode in the example. It has no HIGH_SPEED switch, so I inserted setMeasurementTimingBudget() manually. Further more I reduced the sketch to the minimum (no TIMEOUT ckecking, just one println). The code is attached.

/* 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 <Wire.h>
#include <VL53L0X.h>

VL53L0X sensor;

void setup()
{
  // Serial.begin(9600);
  Serial.begin(115200);
  Wire.begin();

  sensor.init();
  // sensor.setTimeout(500);

  // Start continuous back-to-back mode (take readings as
  // fast as possible).  To use continuous timed mode
  // instead, provide a desired inter-measurement period in
  // ms (e.g. sensor.startContinuous(100)).
  sensor.setMeasurementTimingBudget(20000);
  sensor.startContinuous();
}

void loop()
{
  // Serial.print(sensor.readRangeContinuousMillimeters());
  // if (sensor.timeoutOccurred()) { Serial.print(" TIMEOUT"); }

  // Serial.println();
  Serial.println(sensor.readRangeContinuousMillimeters());
}

I get values from Arduino IDE like the following (no 20 ms intervals):

07:24:53.948 -> 52
07:24:53.981 -> 56
07:24:53.981 -> 49
07:24:54.015 -> 49
07:24:54.015 -> 57
07:24:54.048 -> 54
07:24:54.048 -> 53
07:24:54.081 -> 55
07:24:54.114 -> 48
07:24:54.114 -> 51
07:24:54.148 -> 50
07:24:54.148 -> 54
07:24:54.181 -> 54
07:24:54.181 -> 55
07:24:54.214 -> 49
07:24:54.214 -> 50
07:24:54.247 -> 50
07:24:54.281 -> 55
07:24:54.281 -> 49
07:24:54.314 -> 52
07:24:54.314 -> 54
07:24:54.347 -> 48
07:24:54.347 -> 52
07:24:54.380 -> 49
07:24:54.380 -> 51
07:24:54.414 -> 48
07:24:54.447 -> 51
07:24:54.447 -> 48
07:24:54.480 -> 53
07:24:54.480 -> 52
07:24:54.513 -> 56
07:24:54.513 -> 48

It seems to me, that setMeasurementTimingBudget() is not enough to minimize the time for measurement. Has it ever worked at someone?

Reading the datasheet link (thanks!) I’m not sure, if 8 ms is theoretically possible. Maybe the datasheet means:

Initialization (~1ms*) plus
Range set up (~8ms*) plus
Range measurement (~8ms) plus
Digital processing (~0.8ms*)

In sum it is near 20 ms, but maybe I’m wrong with this interpretation. I would be happy, if even 20 ms would be possible. Down to 8 ms would be a dream.