ADS1115_BRVG_UserGuide

In Nature Robotics Ltd. www.innaturerobotics.com
ads.begin();
}
void loop() {
int16_t adc0;
int16_t adc1;
int16_t adc2;
int16_t adc3;
adc0 = ads.readADC_SingleEnded(0);
adc1 = ads.readADC_SingleEnded(1);
adc2 = ads.readADC_SingleEnded(2);
adc3 = ads.readADC_SingleEnded(3);
fVoltages[0] = (adc0*0.1875)/1000;
fVoltages[1] = (adc1*0.1875)/1000;
fVoltages[2] = (adc2*0.1875)/1000;
fVoltages[3] = (adc3*0.1875)/1000;
Serial.print(fVoltages[0],3);
Serial.print("\t");
Serial.print(fVoltages[1],3);
Serial.print("\t");
Serial.print(fVoltages[2],3);
Serial.print("\t");
Serial.print(fVoltages[3],3);
Serial.println();
delay(1000);
}
Raspberry Pi Sample Code
The program below also uses the default ADS1115 gain of 2/3, so that the reference
voltage is ±4.096V/ (2/3) = ± 6.144V. The program samples the single-ended voltage on
all 4 channels and prints out the results. The program requires the “AToD.h” and
“AToD.cpp” library files from In Nature Robotics Ltd. Links to these files are available
from the ADS1115-BRVG product page at www.innaturerobotics.com.
#include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <memory>
#include "AToD.h"