Unfortunately the underlying Polulu library for the VL53L1X doesn’t provide a function to change the size of the ROI and so there wasn’t an easy way to add such a node. However, it would be a useful addition. I’m really busy at the moment, but in a week or two I should have some time to work on this.
Thanks Wayland!
Is there a easy way to change/ add analog input pin for VL53L1x?I want to use two sensors and I can’t see how to do that.
Thanks in advance
/Stefan
The sensors will need to have different I2C addresses. It’s possible to change the I2C address of the VL53L1X using the Polulu C++ library, but I didn’t create a node for this function in my XOD library. When I update my library I’ll add a set-address node. In the meantime, you could use a multiplexer (e.g. https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout) to work with multiple sensors.
Sorry to hear that you’ve run into a problem. I’ve just tested my library to make sure that it is working with the latest version of XOD (0.38.0) and all seems to be well:
Like you, I’m using an Arduino Uno. However, I’m using a different breakout board:
I think the issue is that the TOF400F uses the VL53L1 chip, rather than the VL53L1X chip. Unfortunately XOD doesn’t currently have a library for the VL53L1.
It might be worth scanning the I2C bus using @cesarsi2c-scanner. If the ranging chip is a VL53L1X, the I2C scanner should report an address of 29h:
If you have a VL53L1 chip, the reported address will be 52h.
The VL53L1 uses I2C to communicate, so if the i2c-scanner cannot find the device, then there must be a problem with the device, the Arduino or the way they have been wired together. Is the Arduino able to detect other I2C devices?
If you are able to resolve the hardware issue and successfully communicate with the VL53L1 using I2C, then you can potentially use the device with XOD. As XOD doesn’t have a library for the VL53L1, you will have to create your own. There are two options for doing this:
If you’ve got some experience with C++, you could wrap the Arduino library for the VL53L1. Official documentation for wrapping libraries can be found here. An unofficial guide can be found here.
Alternatively, if you want to avoid C++, you could build a library using the XOD I2C nodes.