-
Hi, I have tried the same code with and without cover glass. My circuit uses 2.2k pull up resistor, I tried different pull up values as mentioned in the data sheet but it didn't had any effect. I am changing address of all the sensors on start up and it works fine. I'm using teensy 4.0 and have incremented the i2c buffer length to 255 in wire library, so that blocking function works properly. Any help would be appreciated. Thank you very much. This is my code. void init(){
for (unsigned int i = 0; i < 16; I++)
{
mcp.digitalWrite(i, HIGH);// Shut connected to a mix
sensors[i].VL53L4CX_WaitDeviceBooted();
sensors[i].begin();
sensors[i].InitSensor(address);
sensors[i].VL53L4CX_StartMeasurement();
address = address + 2;
delay(10);
}
Wire.setClock(1000000);
}
void readDistance(bool instrument, int modSensorsPos, int modSensorsNum)
{
VL53L4CX_MultiRangingData_t MultiRangingData;
VL53L4CX_MultiRangingData_t *pMultiRangingData = &MultiRangingData;
for (int i = 0; i < 16; I++)
{
status = sensors[i].VL53L4CX_WaitMeasurementDataReady();
status = sensors[i].VL53L4CX_GetMultiRangingData(pMultiRangingData);
distI[i] = pMultiRangingData->RangeData[0].RangeMinMilliMeter / 10.0; // mm to cm
status = sensors[i].VL53L4CX_ClearInterruptAndStartMeasurement();
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, @cparata should probably answer better than me. |
Beta Was this translation helpful? Give feedback.
-
Hello @kiranps19 ,
with
I noticed that the "VL53L4CX_WaitMeasurementDataReady" API has an internal delay that maybe repeated for all the sensors can give some issues. |
Beta Was this translation helpful? Give feedback.
Hello @kiranps19 ,
did you try to run the example with an I2C speed of 400 KHz? Is there any difference? Another test that you can do is replacing the line:
status = sensors[i].VL53L4CX_WaitMeasurementDataReady();
with
I noticed that the "VL53L4CX_WaitMeasurementDataReady" API has an internal delay that maybe repeated for all the sensors can give some issues.
Let me know what happens on your side.
Best Regards,
Carlo