Other Parts Discussed in Thread: ADS1015
Hello,
I have two ADS1115 and attempting to use with Arduino UNO board.
I'm following instructions presented on https://learn.adafruit.com/adafruit-4-channel-adc-breakouts.
Arduino Library from Adafruit is used and can be download on https://github.com/adafruit/Adafruit_ADS1X15
I'm tryed to read voltage from Arduini +3.3V but all I get from the code is "-1" as value.
AIN0: -1 AIN0: -1 AIN0: -1 AIN0: -1 AIN0: -1
I've searched on several sources and what I could see is that if I get a "-1" value is probably an i2c problem.
What is wrong?
I've testes with 2 different ADS1115 and both gives me the same result.
The .ino code is presented as follows.
Files .ccp and .h from my library is attached to this post.
#include <Wire.h> #include <Adafruit_ADS1015.h> Adafruit_ADS1115 ads(0x48); 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)"); ads.begin(); } void loop(void) { int16_t adc0; adc0 = ads.readADC_SingleEnded(0); Serial.print("AIN0: "); Serial.println(adc0); Serial.println(" "); delay(1000); }