ADS1115 single ended mode differential

Hi
I'm testing ADS1115, the example is for SingleEnded mode, how to change to differential mode ?

//===========================
//ADS1115 four inputs example
//===========================
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_ADS1015.h>
Adafruit_ADS1115 ads;
//OLED===================================================================
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET     4
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
//=======================================================================
void setup(void) 
{
  Serial.begin(9600);
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) 
  {
    Serial.println(F("SSD1306 allocation failed"));
    for (;;); // Don't proceed, loop forever
  }
  display.clearDisplay(); 
  analogReference(INTERNAL);
  ads.begin();
}
//======================================================================
void loop(void) 
{
  int16_t adc0, adc1, adc2, adc3;
  float Vadc0, Vadc1, Vadc2, Vadc3;
  
  adc0 = ads.readADC_SingleEnded(0);
  adc1 = ads.readADC_SingleEnded(1);
  adc2 = ads.readADC_SingleEnded(2);
  adc3 = ads.readADC_SingleEnded(3);
  
  display.setTextColor(WHITE);
  display.setTextSize(2);
  display.clearDisplay();
  display.setCursor(30,0); display.print(adc0);
  display.setCursor(30,15); display.print(adc1);
  display.setCursor(30,30); display.print(adc2);
  display.setCursor(30,45); display.print(adc3);
  display.display(); delay(1000);
}

Isn't there a differential example in the IDE ?
int xxx = ads.readADC_Differential_0_1(); // seems to do it
Leo..

Here's a link from Adafruit with the commands for reading channels 0 and 1 as mentioned by @Wawa , as well as 2 and 3:

Thanks , this is it what I was looking for.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.