 #include <ESP8266WebServer.h>
 #include <ESP8266mDNS.h>
 #include "SSD1306.h" // SSD1306
+#include "Adafruit_MCP23017.h" //Adafruit-MCP23017-Arduino-Library
 
  //CONSTANTS/VARIABLES/GLOBALS-------------------------------------------------------------
+Adafruit_MCP23017 mcp; //Adafruit-MCP23017-Arduino-Library
 SSD1306  display(0x3c, D3, D5); // SSD1306 Pin Assignments
 MDNSResponder mdns;
 

    server.on("/relay3On", [](){
    server.send(200, "text/html", webPage);
    // Turn on RELAY
    digitalWrite(k3Pin, LOW);
    Serial.println("RELAY 3 ON");
    delay(500);
  });
  server.on("/relay3Off", [](){
    server.send(200, "text/html", webPage);
    //Turn off RELAY
    digitalWrite(k3Pin, HIGH);
    Serial.println("RELAY 3 OFF");
    delay(500); 
  });

const char* password = "haxor1337";       //wifi password

//PIN DEFINITIONS

//VARIABLES
int relayState = 0;

 //SETUP-----------------------------------------------------------------------------------
void setup() {

  mcp.begin();      // use default address 0 Adafruit-MCP23017-Arduino-Library
  
  display.init(); //SSD12306 init
  
  display.flipScreenVertically(); //SSD12306
  display.setFont(ArialMT_Plain_10); //SSD12306 set font

//set PORT A I/O expander pins to OUTPUTS
  mcp.pinMode(0, OUTPUT); //MCP23017 PIN 21 GPA0 (K1 RELAY)
  mcp.pinMode(1, OUTPUT); //MCP23017 PIN 22 GPA1 (K2 RELAY)
  mcp.pinMode(2, OUTPUT);
  mcp.pinMode(3, OUTPUT);
  mcp.pinMode(4, OUTPUT);
  mcp.pinMode(5, OUTPUT);
  mcp.pinMode(6, OUTPUT);
  mcp.pinMode(7, OUTPUT);

// ensure that each pin defaults to HIGH (relay off)
// these cheap blue relay modules use active low logic.
  mcp.digitalWrite(0, HIGH); //K1
  mcp.digitalWrite(1, HIGH); //K2
  mcp.digitalWrite(2, HIGH); //K3
  mcp.digitalWrite(3, HIGH); //K4
  mcp.digitalWrite(4, HIGH); //K5
  mcp.digitalWrite(5, HIGH); //K6
  mcp.digitalWrite(6, HIGH); //K7
  mcp.digitalWrite(7, HIGH); //K8

//Webpage Heading
  webPage += "<h1>ASC - Alexa Sprinkler Controller</h1>";
