   display.drawString(48, 45, (stringVal));
   
   // Check for Alert
-  alertPinState = digitalRead(ALERT_PIN); // read the Alert from pin
+  alertPinState = digitalRead(alertPin); // read the Alert from pin
   alertRegisterState = sensor0.alert();   // read the Alert from register
-
-
+  
   /*
   // Print temperature and alarm state
   Serial.print("Temperature: ");

  Serial.println(alertRegisterState);
  */
}
//function to extract decimal part of float
long getDecimal(float val)
{
  int intPart = int(val);

/*
 * ===============================================================================================
 * Title: ASC - Alexa Sprinkler Controller
 * Description: ESP8266 Based, Arduino compatible, Alexa commandable, sprinkler controller. 
 * Author: Ramsey Gill  
 * License MIT
 * Homepage: https://hackaday.io/project/26850-alexa-enabled-sprinkler-controller
 * GitHub: https://github.com/ramseygill/alexa-sprinkler
 * ===============================================================================================
 * NOTES, Credit, Sources, and Props
 * TIME EXAMPLE:http://www.geekstips.com/arduino-time-sync-ntp-server-esp8266-udp/
 * Adafruit-MCP23017-Arduino-Library
 * Copyright (c) 2012, Adafruit Industries All rights reserved.
 * https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library/blob/master/license.txt
 */
//------------------------------------------------------------------------------------------------
//LIBRARIES
//------------------------------------------------------------------------------------------------

#include <ESP8266WiFi.h>        // ESP8266 (ESP-12E) wifi library
#include "SSD1306.h"            // SSD1306 OLED display 
#include "Adafruit_MCP23017.h"  // Adafruit-MCP23017-Arduino-Library, GPIO EXPANDER
#include "SparkFunTMP102.h"     // TMP102 I2C temperature sensor 
#include "fauxmoESP.h"          // Alexa suppport (fake WeMo devices)

//------------------------------------------------------------------------------------------------
//VARIABLES AND GLOBALS
//------------------------------------------------------------------------------------------------

// PIN DEFINITIONS
const int I2C_SDA = 0;      //I2C bus data pin (SCL).
const int I2C_SCL = 14;     //I2C bus clock pin (SCL).
const int alertPin = 5;     //TMP102 alert pin. ESP8266 Pin 
const int relayPin_K1 = 0;  //K1 relay control pin. MCP23017 Pin 21/GPA0
const int relayPin_K2 = 1;  //K2 relay control pin. MCP23017 Pin 22/GPA1
const int relayPin_K3 = 2;  //K3 relay control pin. MCP23017 Pin 23/GPA2
const int relayPin_K4 = 3;  //K4 relay control pin. MCP23017 Pin 24/GPA3
const int relayPin_K5 = 4;  //K5 relay control pin. MCP23017 Pin 25/GPA4
const int relayPin_K6 = 5;  //K6 relay control pin. MCP23017 Pin 26/GPA5
const int relayPin_K7 = 6;  //K7 relay control pin. MCP23017 Pin 27/GPA6
const int relayPin_K8 = 7;  //K8 relay control pin. MCP23017 Pin 28/GPA7

// GLOBAL DEFS
#define WIFI_SSID "skynet-2GHz" //your wifi SSID
#define WIFI_PASS "haxor1337"   //your wifi password 
#define SERIAL_BAUDRATE 115200  //Set USB serial baud rate

// LIBRARY INITIALIZATION
fauxmoESP fauxmo;                         // Initialize fauxmo
TMP102 sensor0(0x48);                     // Initialize sensor at I2C address 0x48
Adafruit_MCP23017 mcp;                    // Adafruit-MCP23017-Arduino-Library
SSD1306  display(0x3c, I2C_SDA, I2C_SCL); // SSD1306 Pin Assignments

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

  //CONFIGURE PIN USAGE
  pinMode(alertPin,INPUT);  // Declare alertPin as an input TMP102
  //set PORT A I/O expander pins to OUTPUTS for relay use
  mcp.pinMode(relayPin_K1, OUTPUT); 
  mcp.pinMode(relayPin_K2, OUTPUT); 
  mcp.pinMode(relayPin_K3, OUTPUT);
  mcp.pinMode(relayPin_K4, OUTPUT);
  mcp.pinMode(relayPin_K5, OUTPUT);
  mcp.pinMode(relayPin_K6, OUTPUT);
  mcp.pinMode(relayPin_K7, OUTPUT);
  mcp.pinMode(relayPin_K8, OUTPUT);

  //FAUXMO DEVICES  
  //(each of these devices will appear in Alexa App
  fauxmo.addDevice("Zone A1");
  fauxmo.addDevice("Zone A2");
  fauxmo.addDevice("Zone A3");
  fauxmo.addDevice("Zone A4");
  fauxmo.addDevice("Zone A5");
  fauxmo.addDevice("Zone A6");
  fauxmo.addDevice("Zone A7");
  fauxmo.addDevice("Zone A8");
  fauxmo.onMessage(callback); //function call?

  //START I2C COMMUNICATION
  mcp.begin();      // MCP23017 - I/O Expander start I2C comms
  sensor0.begin();  // TMP102 - Temp Sensor start I2C comms
  display.init();   // SSD12306 - OLED screen start I2C comms
  //Flip Screen orientation in software, (pins on top)
  display.flipScreenVertically(); //SSD12306

//------------TMP102 Setup----------------------------------------------------------
  // Initialize sensor0 settings
  // These settings are saved in the sensor, even if it loses power
  
