adafruit / Adafruit_ADS1X15

Driver for TI's ADS1015: 12-bit Differential or Single-Ended ADC with PGA and Comparator
Other
298 stars 307 forks source link

Incorrect pin assignments A0-A3 in .h file #43

Closed Bwanna closed 4 years ago

Bwanna commented 4 years ago

Observation: -On breadboard and testing A0-A3 between Vdd and Gnd the following occurs: -Analog input >> Serial Printed ouput A0 -- A1 A1 -- A2 A2 -- A3 A3 -- A0

Recommendation: -Verify assignments. (Sorry, I'm still learning about writing .h and .cpp files so not confident in suggesting changes to these.)

Bwanna commented 4 years ago

The following changes in the "Adafruit_ADS1015.h" seem to work: ORIGINAL:

define ADS1015_REG_CONFIG_MUX_SINGLE_0 (0x4000) // Single-ended AIN0

#define ADS1015_REG_CONFIG_MUX_SINGLE_1 (0x5000)  // Single-ended AIN1
#define ADS1015_REG_CONFIG_MUX_SINGLE_2 (0x6000)  // Single-ended AIN2
#define ADS1015_REG_CONFIG_MUX_SINGLE_3 (0x7000)  // Single-ended AIN3

CHANGED:

define ADS1015_REG_CONFIG_MUX_SINGLE_0 (0x5000) // Single-ended AIN0

#define ADS1015_REG_CONFIG_MUX_SINGLE_1 (0x6000)  // Single-ended AIN1
#define ADS1015_REG_CONFIG_MUX_SINGLE_2 (0x7000)  // Single-ended AIN2
#define ADS1015_REG_CONFIG_MUX_SINGLE_3 (0x4000)  // Single-ended AIN3
caternuson commented 4 years ago

I can't recreated this issue. I used a Feather ESP32 with an ADS1115 breakout running the singleended.ino example. Jumpering a wire from VDD or GND to each of the Ax inputs shows up as expected in the serial monitor output.

What ADS1115 breakout are you using?

caternuson commented 4 years ago

Closing due to lack of response.