Multiple ROI procedure on VL53L1X using ULD - how to?
Hi,
I'm using ULD to get measurements from VL53L1X. My case need to get 9 ROI - divided FoV into 3x3.
When I run such measurement procedure it with 2x2 = 4 RoI - It's okay. But when I get 3x3 RoI in a similar way I get measurements such as max u16_t = 65535 and my first 3 from 9 RoI center (which I get using VL53L1X_GetROICenter) oscillates around some point.
My measurement procedure is like:
/*run on 3 sensors*/
status = VL53L1X_GetROICenter(sensorAddr, &roiCenter);
status = VL53L1X_StartRanging(sensorAddr);
/* ........ */
while (!allSensorsMeasReady)
{
VL53L1X_CheckForDataReady(VL53L1X_I2C_ADDR_1, &dataReady[0]);
VL53L1X_CheckForDataReady(VL53L1X_I2C_ADDR_2, &dataReady[1]);
VL53L1X_CheckForDataReady(VL53L1X_I2C_ADDR_3, &dataReady[2]);
k_sleep(K_MSEC(2));
allSensorsMeasReady = dataReady[0] && dataReady[1] && dataReady[2];
}
dataReady[0] = 0;
dataReady[1] = 0;
dataReady[2] = 0;
/*run on 3 sensors*/
status += VL53L1X_GetRangeStatus(sensorAddr, &RangeStatus);
status += VL53L1X_GetDistance(sensorAddr, &Distance);
status += VL53L1X_ClearInterrupt(sensorAddr);
status = VL53L1X_StopRanging(sensorAddr);
/* ....some calculations... */
setROIStatus = VL53L1X_SetROI(sensorAddr, 8, 8); //must be
status = VL53L1X_SetROICenter(sensorAddr, center[Zone]);
Is there any problem with ULD? Or it is a hardware case? I tested such code on a different VL53L1X sensor.
Do I need to change the procedure?
PS Intermeasurement and timing budget is set to 20 ms.
Kind Regards!
Maciej
