User avatar
bitbank
Posts: 252
Joined: Sat Nov 07, 2015 8:01 am
Location: Sarasota, Florida
Contact: Website

C Library for VL53L0X time of flight distance sensor

Tue Nov 07, 2017 4:32 pm

The VL53L0X is a great sensor for measuring accurate distances between 4 and 100cm. The problem is that ST Micro designed the I2C interface specifically to hide the details of how to use the chip. Their documentation doesn't actually include any info about how to communicate with it over I2C. They publish an "API" which is licensed software and may not be easy to add to your project. Pololu published an Arduino library for the VL53L0X by reverse engineering the ST Micro code. I used their code as a starting point and simplified it and rewrote it to work on Linux. The result is a simple C library with 3 functions:

tofInit, tofGetModel, tofReadDistance

Now you can easily add accurate distance sensing to your C projects

https://github.com/bitbank2/VL53L0X
The fastest code is none at all :)

elicorrales
Posts: 16
Joined: Fri Aug 18, 2017 7:03 pm

Re: C Library for VL53L0X time of flight distance sensor

Tue Aug 07, 2018 1:47 pm

Hello,

do you know if your library would be compatible with VL53L1X?

thanks

User avatar
bitbank
Posts: 252
Joined: Sat Nov 07, 2015 8:01 am
Location: Sarasota, Florida
Contact: Website

Re: C Library for VL53L0X time of flight distance sensor

Sat Aug 11, 2018 11:02 pm

elicorrales wrote:
Tue Aug 07, 2018 1:47 pm
Hello,

do you know if your library would be compatible with VL53L1X?

thanks
Unfortunately, it's not. STMicro decided to create a new set of magic numbers to hide their hardware again.
The fastest code is none at all :)

Return to “Automation, sensing and robotics”