 #include <SD.h>
 #include <Wire.h>
 #include "RTClib.h"
-#include <SoftwareSerial.h>      //we have to include the SoftwareSerial library, or else we can't use it. 
-
+#include <Adafruit_RGBLCDShield.h>
+#include <utility/Adafruit_MCP23017.h>
+Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
+#define RED 0x1
+#define YELLOW 0x3
+#define GREEN 0x2
+#define TEAL 0x6
+#define BLUE 0x4
+#define VIOLET 0x5
+#define WHITE 0x7
 const int chipSelect = 10;
 
-unsigned long LOG_INTERVAL = 60000;
+unsigned long LOG_INTERVAL = 25000;
 unsigned long previousMillis = 0;
 
-
 // The analog pins that connect to the sensors
-#define PressureAnalog A1      // analog 1
+#define PressureAnalog A0      // analog 1
 
 // define the Real Time Clock object
 RTC_PCF8523 RTC; 

    String DYs = String(DY,DEC);
    String DATE = YRs + MOs + DYs;
    String filename = DATE + ".CSV";
  
    //collect data
    //Average repetative current and voltage readings between sampling interval
    PressureAnalogReading = PressureReadingSUM / readingCount;    
    float P = PressureAnalogReading / 102.94;
    
    delay(10); 
    
    //read total flow once per sampling interval
    
    delay(200);
    
    // make a string for assembling the data to log:
    String dataString = "";
    dataString += String(now.unixtime());dataString += ",";
    dataString += String(P);

      dataFile.close();
      // print to the serial port too:
      Serial.println(dataString);
      lcd.setCursor(0,1);
    lcd.print("it works");
    }
    // if the file isn't open, pop up an error:
    else {
      Serial.print("error opening ");Serial.print(filename);Serial.println("!");
    }
  */
    delay(10000); 
    //reset averaging tools if interval is met
    readingCount=0; 
    PressureReadingSUM = 0;
  }
}
