ADS1115 ComparatorDifferential
ADS1115 ComparatorDifferential
ADS1115 ComparatorDifferential
/*
Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
ADS1115
This code is designed to work with the ADS1115_I2CADC I2C Mini Module available from
ControlEverything.com.
https://www.controleverything.com/content/Analog-Digital-Converters?
sku=ADS1115_I2CADC#tabs-0-product_tabset-2
*/
/**************************************************************************/
#include <Wire.h>
#include <ADS1115.h>
ADS1115 ads;
void setup(void)
Serial.begin(9600);
// The address can be changed making the option of connecting multiple devices
// ads.setRate(RATE_8); // 8SPS
// ads.setRate(RATE_16); // 16SPS
// ads.setRate(RATE_32); // 32SPS
// ads.setRate(RATE_64); // 64SPS
// ads.setRate(RATE_250); // 250SPS
// ads.setRate(RATE_475); // 475SPS
// ads.setRate(RATE_860); // 860SPS
// Be careful never to exceed VDD +0.3V max, or the upper and lower limits
ads.setHighThreshold(32000);
// ads.setLowThreshold(0);
ads.begin();
delay(1000);
void loop(void)
byte error;
int8_t address;
address = ads.ads_i2cAddress;
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
Serial.println("Getting Comparator Differential Readings from AIN01, AIN03, AIN13 and AIN23");
Serial.println(" ");
result01 = ads.Comparator_Differential(01);
Serial.println(result01);
result03 = ads.Comparator_Differential(03);
result13 = ads.Comparator_Differential(13);
Serial.println(result13);
result23 = ads.Comparator_Differential(23);
Serial.println(result23);
Serial.println(" ");
Serial.println(" ");
else
Serial.println("ADS1115 Disconnected!");
Serial.println(" ");
Serial.println(" ");
delay(1000);