Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: IGGE_Power ADS1015-hello_world ADS1115-hello_world frdm_rtos_Eth ... more
You are viewing an older revision! See the latest version
Homepage
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 ack, DEBUG
wait(2); // loop 2 sek
}
}