pololu / vl53l0x-arduino

Pololu Arduino library for VL53L0X time-of-flight distance sensor
https://www.pololu.com/product/2490
Other
346 stars 162 forks source link

VL53l0X multiple interface with atmega 2560 using c libraray #38

Open Aashutosh3804 opened 4 years ago

Aashutosh3804 commented 4 years ago

How can I interface multiple 3 VL53L0X at same time with atmega 2560 using avr-gcc and not Arduino I seen a library based on this one but don't know how to use that for multiple sensors please help Library used: https://github.com/yetifrisstlama/vl53l0x-non-arduino

kevin-pololu commented 4 years ago

Hi,

If you're still looking for help with this, you might want to start by reading ST's application note AN4846, "Using multiple VL53L0X in a single design". The general approach is to start with all sensors disabled using their XSHUT pins, then enable one sensor at a time and change its address to something unique before continuing with the next sensor.

We don't have an example program showing how to do this, but this seems to be a common enough question that I think we should consider adding a library example, and I'll keep this issue open to remind us of this. In the meantime, you can find some discussion and other users' code on our forum (this looks like it should work with our library). The forum is also a better place to ask if you need any help troubleshooting any code that uses our library, although we probably cannot offer much specific advice about using the modified library that you linked to (where it differs from ours).

Kevin