cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L1 2.0 Library

ritzeng
Associate II

Unused code detected:

VL53L1_Error VL53L1::VL53L1_RdByte(VL53L1_DEV Dev, uint16_t index, uint8_t *data)

{

int status;

status = VL53L1_I2CRead(Dev->I2cDevAddr, index, data, 1);

//FR bug :: I2CRead exits always with 0! why the following check? Unused.

if (status) {

return -1;

}

return 0;

}

3 REPLIES 3
John E KVAM
ST Employee

The I2CRead function has to be implemented for the customer's MCU. It's maybe that some implementations have a non-zero status from the call.

Some might not, but we cannot count on that.

  • john

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
ritzeng
Associate II

Hello John,

which of the lIbrary functions is like this that we, customers, have to adapt.

I did not mention this (Wire, I2C Bus etc.). Maybe it was written somehow.

I got a Interrupt based version running, but with a very difficult timing of VL53L1_ClearInterruptAndStartMeasurement()

and

L53L1_GetMultiRangingData()

It seems not to be a real Shakehand because of the timing.

But I'll write this in an extra message these days. This sensor is very difficult to get it run. I've had never this before.

Best regards

Frank

ritzeng
Associate II

I solved the problem. The provided examples software for Arduino Environment's never worked. I will publish my example and the working solution at my GitHub the next days. It's running on ESP 8266 and ESP32 and STM platforms.