NORVI-EX-I16 User Guide

Programming #

NORVI-EX-I16 uses MCP23017 over I2C Communication. The I2C Address of the devices can be configured with the DIP Switches in the bottom of the controller.

Digital Inputs #

Wiring Digital Inputs #

The digital inputs of NORVI Expansions range can be configured as both Sink and Source connection. The inverse of the Digital Input polar should be supplied to common terminal.

EX-I8 Digital Input Wiring

Programming Digital Inputs

Reading relevant GPIO of MCP230008 gives the value of the Digital Input. When the inputs are in OFF state the GPIO goes HIGH, and when the input is in ON stage GPIO goes LOW.

Refer to the GPIO Allocation Table for Digital Input GPIO

Refer to the I2C Address setting to set the I2C address of the Expansion

// Blinks an LED attached to a MCP23XXX pin.

// ok to include only the one needed
// both included here to make things simple for example
//#include <Adafruit_MCP23X08.h>
#include <Adafruit_MCP23X17.h>

#define INPUT1 0
#define INPUT2 1
#define INPUT3 2
#define INPUT4 3

#define INPUT5 4
#define INPUT6 5
#define INPUT7 6
#define INPUT8 7

#define INPUT9 8
#define INPUT10 9
#define INPUT11 10
#define INPUT12 11

#define INPUT13 12
#define INPUT14 13
#define INPUT15 14
#define INPUT16 15

// uncomment appropriate line
//Adafruit_MCP23X08 mcp;
Adafruit_MCP23X17 mcp;

void setup() {
  //while (!Serial);
  Serial.println("NORVO Expansions Test");

  // uncomment appropriate mcp.begin
  Wire.begin (16, 17);   
  if (!mcp.begin_I2C(0x27)) {
    while (1);

  // configure pin for output
  mcp.pinMode(INPUT1, INPUT); mcp.pinMode(INPUT2, INPUT); mcp.pinMode(INPUT3, INPUT); mcp.pinMode(INPUT4, INPUT);
  mcp.pinMode(INPUT5, INPUT); mcp.pinMode(INPUT6, INPUT); mcp.pinMode(INPUT7, INPUT); mcp.pinMode(INPUT8, INPUT);
  mcp.pinMode(INPUT9, INPUT); mcp.pinMode(INPUT10, INPUT); mcp.pinMode(INPUT11, INPUT); mcp.pinMode(INPUT12, INPUT);
  mcp.pinMode(INPUT13, INPUT); mcp.pinMode(INPUT14, INPUT); mcp.pinMode(INPUT15, INPUT); mcp.pinMode(INPUT16, INPUT);


void loop() {

Powered by BetterDocs