A library for ADS1015 and ADS1115 from Texas Instruments.

Dependents:   IGGE_Power ADS1015-hello_world ADS1115-hello_world frdm_rtos_Eth ... more

Use like this

#include "mbed.h"
#include "Adafruit_ADS1015.h"
#include "USBSerial.h"

#define SERIAL_BAUD_RATE    9600

I2C i2c(p23, p18);
Adafruit_ADS1015 ads(&i2c);
USBSerial pc; // USB CDC serial port

 
int main() {
    uint16_t reading;
    while (1) {
        reading = ads.readADC_SingleEnded(0); // read channel 0
        pc.printf("reading: %d\r\n", reading); // print reading    
        wait(2); // loop 2 sek
    }
}

Library ported from Arduino at github repository.

Breakout boards from Adafruit: http://learn.adafruit.com/adafruit-4-channel-adc-breakouts/overview

GitHub repository: https://github.com/adafruit/Adafruit_ADS1X15

History

ads1115 comments default tip

2014-10-11, by arve0 [Sat, 11 Oct 2014 08:45:17 +0000] rev 5

ads1115 comments


merged ads1115 changes

2014-10-11, by arve0 [Sat, 11 Oct 2014 08:44:20 +0000] rev 4

merged ads1115 changes


add comments

2014-10-11, by arve0 [Sat, 11 Oct 2014 08:25:34 +0000] rev 3

add comments


4 space indentation

2014-10-11, by arve0 [Sat, 11 Oct 2014 08:20:09 +0000] rev 2

4 space indentation


fix license

2013-11-10, by arve0 [Sun, 10 Nov 2013 18:44:47 +0000] rev 1

fix license


Ported from Adafruit's arduino library

2013-11-10, by arve0 [Sun, 10 Nov 2013 18:22:27 +0000] rev 0

Ported from Adafruit's arduino library