Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Integrating the vl53l0x with project

Hi, I’ve purchased vl53l0x sensor and it’s working fine with arduino. But wanted to use same sensor with my 32-bit same51x controller. So, using same library in the project as my controller is not arduino I’ve made changes for I2C and can recognise the ID of sensor. But when try to get the data it’s showing timeout. Please help me to find issue with my library. I’m attaching my github link for the library. Github link for vl53l0x library

Thanks

Hello,

We aren’t familiar with that controller, so there isn’t a lot of specific advice we can offer about using it with the VL53L0X. However, from a quick look at your code, I suspect you are not using the right formats for your I2C transfers. In particular, you might be mixing up the VL53L0X’s I2C device address and register addresses (sometimes called “indexes” in the datasheet).

I recommend carefully reading the VL53L0X datasheet, specifically the “Control interface” section, to understand the I2C data formats it expects. Also, if you have an oscilloscope or logic analyzer, it might be useful to look at the I2C communication with our library running on an Arduino and compare that to what your code is doing on your controller.

Kevin

I didn’t understand what is mean by right formats. In my I2C library I’m just directly assigning the address of the board in constructor so I will not have to send address again, while transferring sending only indexes and data. Can you please share a link for the datasheet there are number of datasheets I’m not getting which should I follow for indexes and I2C transfer. The controller I’m using is 32 bit

That’ll be very helpful.

Thanks

Saurabh

You can find the datasheet on the Resources tab of our VL53L0X board’s product page or on ST’s website.

Kevin