ADS1115

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
chuseuiti
 
Posts: 1
Joined: Mon Sep 08, 2014 12:31 pm

ADS1115

Post by chuseuiti »

Hi!
I am having some issues with the ADS1115, every time I try to use the readADC_SingleEnded(uint8_t channel) or any other function the only thing that I can get is -1.

Here is the code:

Code: Select all

#include<Wire.h>
//Ads
#include <Adafruit_ADS1015.h>

Adafruit_ADS1115 ads1115(0x49);

void setup()
{
  
  

  pinMode(9, OUTPUT);  // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
  digitalWrite(9, HIGH);
  Serial.begin(9600);
  ads1115.begin(); 

}

void loop(){
  
  
int adc0, adc1, adc2, adc3;
 
adc0 = ads1115.readADC_SingleEnded(0);//Wire.read();//ads1115.readADC_Differential_0_1();//ads1115.readADC_SingleEnded(0);
adc1 = ads1115.readADC_SingleEnded(1);
adc2 = ads1115.readADC_SingleEnded(2);
adc3 = ads1115.readADC_SingleEnded(3);
Serial.print("AIN0: "); Serial.println(adc0);
Serial.print("AIN1: "); Serial.println(adc1);
Serial.print("AIN2: "); Serial.println(adc2);
Serial.print("AIN3: "); Serial.println(adc3);

 delay(1000);
}

Solution:

There were a couple of problems:

1. The wires where in the right place but they were not doing contact with ADS.
2. I was still getting weird results after fixing the contacts,and it was because the ground was at 3500...
Attachments
phpQ4fI7GAM.jpg
phpQ4fI7GAM.jpg (252.17 KiB) Viewed 254 times
phpWrH2BXAM.jpg
phpWrH2BXAM.jpg (277.88 KiB) Viewed 254 times
Last edited by Franklin97355 on Mon Sep 08, 2014 9:26 pm, edited 1 time in total.
Reason: Added [code] tags.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”