Hello,
I've connected Arduino Uno with ADS1115. The output shows "Failed to initialize ADS".
I tried the code for esp32 with the same ADS and it works fine. I came across similar questions on the forum, but I still can't solve the issue. I've also connected pull-up resistors for SCL and SDA
THIS IS THE CODE
#include <Adafruit_ADS1X15.h>
Adafruit_ADS1115 ads; /* Use this for the 16-bit version */
//Adafruit_ADS1015 ads; /* Use this for the 12-bit version */
void setup(void)
{
Serial.begin(9600);
Serial.println("Hello!");
Serial.println("Getting single-ended readings from AIN0..3");
Serial.println("ADC Range: +/- 6.144V (1 bit = 3mV/ADS1015, 0.1875mV/ADS1115)");
ads.setGain(GAIN_ONE); // 1x gain +/- 4.096V 1 bit = 2mV 0.125mV
if (!ads.begin()) {
Serial.println("Failed to initialize ADS.");
//while (1);
}
}
void loop(void)
{
int16_t adc3;
float volts3;
adc3 = ads.readADC_SingleEnded(3);
volts3 = ads.computeVolts(adc3);
Serial.print("AIN3: "); Serial.print(adc3); Serial.print(" "); Serial.print(volts3); Serial.println("V");
delay(1000);
}
Output :