Hello, I have been using a single ADS1115 on an esp32 with the Adafruit library:
Adafruit_ADS1X15.h
I now need to add a second one as I need to measure 6 things.
I have tried to find how to address multiple ads using the arduino interface and this library, and all have given the solution as:
Adafruit_ADS1115 ads0(0x48);
Adafruit_ADS1115 ads1(0x49);
However I get an error: no matching function for call to 'Adafruit_ADS1115::Adafruit_ADS1115(int)'
It will let me define multiple ads like below:
Adafruit_ADS1115 ads0;
Adafruit_ADS1115 ads1;
and call functions with each like this:
adc0 = ads0.readADC_SingleEnded(0);
adc1 = ads0.readADC_SingleEnded(1);
adc2 = ads0.readADC_SingleEnded(2);
adc3 = ads0.readADC_SingleEnded(3);
results = ads1.readADC_Differential_0_1();
but how would I know or dictate which address each corresponds to?
Each will be doing different things and be wired in with their addresses via a wire to gnd or vdd, so i need to know which ads the function is pointing to.
Any guidance would be appreciated.