Question
Timing budget not kept in VL53L1X
I am trying to get consecutive measurements from the VL53L1X sensor but the timing budget is only kept on the first measurement with the below code
VL53L1X_BootState(dev, &sensorState);
VL53L1X_SensorInit(dev);
VL53L1X_SetDistanceMode(dev, 2);
VL53L1X_SetTimingBudgetInMs(dev, 500);
VL53L1X_SetInterMeasurementInMs(dev, 500);
VL53L1X_StartRanging(dev);
while (count<5) {
count++;
dataReady = 0;
while (!dataReady) {
VL53L1X_CheckForDataReady(dev, &dataReady);
Delay(2);
}
VL53L1X_GetRangeStatus(dev, &status);
aLidarCurrValueValid = !VL53L1X_GetDistance(dev, &aLidarCurrValue);
}
VL53L1X_StopRanging(dev);So in the first measurement the timing budget is kept but in the consecutive ones the dataready byte is instantly 0 which seems to be wrong.
What am I doing wrong?
thanks
