 const char* pin5Name = "pin5Value";
 const char* pin6Name = "pin6Value";
 
+int handlePost(String command);
+
 void setup()
 {
   Serial.begin(9600);
   strip.begin();
   strip.show();
-  
+
+  //get persistent values
+  pulseCount = EEPROM.read(EEPROM_ADDR_PULSE_COUNT);
+  maxPulseCount = EEPROM.read(EEPROM_ADDR_MAX_PULSE_COUNT);
+  percentFull = EEPROM.read(EEPROM_ADDR_PERCENT_FULL);
+
+  //pin modes
   pinMode(pin0, INPUT_PULLDOWN);
   pinMode(pin1, INPUT_PULLDOWN);
   pinMode(pin2, INPUT_PULLDOWN);
   pinMode(pin3, INPUT_PULLDOWN);
-//   pinMode(pin4, INPUT_PULLDOWN);
   pinMode(pin4, INPUT_PULLDOWN);
   pinMode(pin5, INPUT_PULLDOWN);
   pinMode(pin6, INPUT_PULLDOWN);
-//   pinMode(pin6, INPUT);
 
   pinMode(ledPin, OUTPUT);
 
+  //cloud variables
   Spark.variable(pin0Name, &pin0Value, INT);
   Spark.variable(pin1Name, &pin1Value, INT);
   Spark.variable(pin2Name, &pin2Value, INT);

int pin5Value = 0;
int pin6Value = 0;

int pulseCount = 0;
int pulseSerial = 0;
int currentSecond = 1;
int previousSecond = 0;


  {
    if(*pinValue == 1)
    {
      *pinValue = 0;
      digitalWrite(ledPin, HIGH);
      instantPulseCount++;
      pulseCount++;
    }
  }
  
