   Serial.println("SETUP DONE");
 }
 
-//TODO: make this work for 3 taps
 int handlePost(String postData)
 {
   String* args = stringSplit(postData, ',');

  
  pinMode(ledPin, OUTPUT);
  
  //read any values set in the EEPROM
  // maxPulseCount = EEPROM.read(EEPROM_ADDR_MAX_PULSE_COUNT);
  // pulseCount = EEPROM.read(EEPROM_ADDR_PULSE_COUNT);
  // percentFull = EEPROM.read(EEPROM_ADDR_PERCENT_FULL);

  //https://api.particle.io/v1/devices/<device_id>/<variable_name>?access_token=<access_token>
  Particle.variable("maxPCntT0", &T0.maxPulseCount, INT);

  {
    if(T2.pulseCount > T2.maxPulseCount)
      T2.pulseCount = T2.maxPulseCount;
    EEPROM.put(EEPROM_ADDR_T1, T1);
    recalculateTapColor(2);
  }
}

int resetPulseCount(int tap)
{
  if(tap == 0)
  {
    T0.pulseCount = T0.maxPulseCount;
    EEPROM.put(EEPROM_ADDR_T0, T0);
  }
  else if(tap == 1)
  {
    T1.pulseCount = T1.maxPulseCount;
    EEPROM.put(EEPROM_ADDR_T1, T1);
  }
  else if(tap == 2)
  {
    T2.pulseCount = T2.maxPulseCount;
    EEPROM.put(EEPROM_ADDR_T2, T2); 
  }
  
  return 1;
}

int setCalibration(int tap, int val)
{
  if(tap == 0)
  {
    T0.maxPulseCount = val;
    EEPROM.put(EEPROM_ADDR_T0, T0);
  }
  else if(tap == 1)
  {
    T1.maxPulseCount = val;
    EEPROM.put(EEPROM_ADDR_T1, T1);
  }
  else if(tap == 2)
  {
    T2.maxPulseCount = val;
    EEPROM.put(EEPROM_ADDR_T2, T2);
  }
  return 1;
}

