Programming #
NORVI-EX-ANI uses ADS1115 over I2C Communication. On devices with address configuration support. The I2C Address of the devices can be configured with the DIP Switches in the bottom of the controller.

4 – 20mA Analog Inputs #
Wiring 4 – 20mA Analog Inputs #
The analog input of the NORVI Analog Expansion input should be connected with reference to the ground input of the controller.



Analog Inputs
Reading relevant Channel of ADS1115 gives the value on the Analog Input. The resolution of the reading can be scaled with PGA of the ADS1115.
Refer to the GPIO Allocation Table for Digital Input GPIO
Refer to the I2C Address setting to set the I2C address of the Expansion
In accessing the Analog Input expansion, Adafruit ADS1x15 library should be added to the Arduino libraries.
Below example code reads the analog inputs on NORVI Analog input expansion and prints on the Serial Monitor.
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_ADS1X15.h>
#define I2C_SCL 17
#define I2C_SDA 16
Adafruit_ADS1115 ads;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Testing Analog Input Expansion Module");
Wire.begin(16,17);
if (!ads.begin(0x48)) {
Serial.println("Failed to initialize ADS.");
while (1);
}
}
void loop() {
// put your main code here, to run repeatedly:
int16_t adc0, adc1, adc2, adc3;
adc0 = ads.readADC_SingleEnded(0);
adc1 = ads.readADC_SingleEnded(1);
adc2 = ads.readADC_SingleEnded(2);
adc3 = ads.readADC_SingleEnded(3);
Serial.println("");
Serial.print("AIN0: "); Serial.print(adc0); Serial.println(" ");
Serial.print("AIN1: "); Serial.print(adc1); Serial.println(" ");
Serial.print("AIN2: "); Serial.print(adc2); Serial.println(" ");
Serial.print("AIN3: "); Serial.print(adc3); Serial.println(" ");
Serial.println("");
}