ADS1115 - mapping


Is there any guide how to work with the ADS1115?
I would like to use the ADS1115 as GPIO pins but I do not know how to call them or map them?

Basically using range finder VL53L0X there is an option to change their address using High/Low on its XSHUT pin.

I didnt find where after adding ADS1115 how to call for their pins how to map them?
Does anyone have link or a guide how to use it on the ardupilot?

Hi Shaddow,

I guess we have the other chat going about this same lidar but in any case, can you explain what you’re trying to do a bit more? I guess you want to connect two of these lidar to the flight controller (a very reasonable thing to do of course) and so a pin on the lidar has to be pulled high? in which case, how about just wiring that pin to the VCC pin on the lidar? that way it will always be high.

Apologies if I’ve misunderstood…

Dear rmackay9

Since the Pixracer have a limited / no usable pins to toggle GPIO HI/LOW I wonder how can I add the ADS1115 to be able to call the ADS1115 pin to be low or high and use it as additional GPIOs
I have no Idea how to use it.

Since the VL53L0X have I2C address of 0x29 and if you want to add more sensors you need different address for each sensor.
To do that you need: (from adafruit)

The good news is its easy to change, the annoying part is each other sensor has to be in shutdown. You can shutdown each sensor by wiring up to the XSHUT pin to a microcontroller pin. Then perform something like this pseudo-code:

Reset all sensors by setting all of their XSHUT pins low for delay(10), then set all XSHUT high to bring out of reset
Keep sensor #1 awake by keeping XSHUT pin high
Put all other sensors into shutdown by pulling XSHUT pins low
Initialize sensor #1 with lox.begin(new_i2c_address) Pick any number but 0x29 and it must be under 0x7F. Going with 0x30 to 0x3F is probably OK.
Keep sensor #1 awake, and now bring sensor #2 out of reset by setting its XSHUT pin high.
Initialize sensor #2 with lox.begin(new_i2c_address) Pick any number but 0x29 and whatever you set the first sensor to
Repeat for each sensor, turning each one on, setting a unique address.

Take a look at my blog Avoidance Experiments with the POC and Benewake TFMINI

I made an Arduino based system using multiple VL53L0X (Called the POC), that are programmed like the adafruit library.
It can be programmed using a GPIO on the Flight Controler, but it might be easier to interface through an Arduino.

The main problem is the sensor, its operational envelope is very limited (max 150 Cm) and does not works well with bright sunshine.

I must say I like @ppoirier’s method. Implementing all this logic inside the ArduPilot driver hardly seems a bit much. Of course it’s open source so if someone wants to take on that development they are welcome to and we can review the PR when/if it arrives.

I’m not sure which pins on the Pixracer can be used as GPIO pins… maybe ask in the gitter channel and perhaps @tridge or someone else will know.