[solved]problem with ADS1015

Hi,

I try to figure out how to program the Adafruit_ADS1015.

I based my tests upon this link : http://learn.adafruit.com/adafruit-4-channel-adc-breakouts/overview

I have an old UNO so neither SDA nor SCL pins. I used as mentioned in the howto pins 4 and 5 to connect SDA and SCL respectively.

I could not repeat exactly the howto as I do not have an ADXL335. I replaced it by a 10K Breadboard trim potentiometer connecting extreme pins to 5volt and gnd and middle one to A0 on the ADS1015.

in other term I should be able to mesure voltage varying between 0 and 5 vold on pin A0

the script I used is the Single Ended Conversion script

    #include <Wire.h>
    #include <Adafruit_ADS1015.h>
     
    Adafruit_ADS1015 ads1015;
     
    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.begin();
    }
     
    void loop(void)
    {
    int16_t adc0;
     
    adc0 = ads1015.readADC_SingleEnded(0);
    
    Serial.print("AIN0: "); Serial.println(adc0);
    
    Serial.println(" ");
    delay(1000);
    }

the result I get is :

Hello!
Getting single-ended readings from AIN0..3
ADC Range: +/- 6.144V (1 bit = 3mV)
AIN0: 4095

AIN0: 4095

AIN0: 4095

When I play with the knob of the pot nothing happens. I guess I do something wrong …

Thanks for your help

Philippe

I used as mentioned in the howto pins 4 and 5 to connect SDA and SCL respectively.

Those pins are the analogue pins 4 & 5 you know not the digital ones.

Hi,

Thanks for your answer.

I am following the howto. They may be wrong but I can't say, I am discovering things.

http://learn.adafruit.com/assets/2675

Philippe

when you mesure something, mesure it three time!

I rewired things several time, and now it works. a wire was not well soldered...

Sorry for the disturbance

Philippe