 unsigned long servoDelay = 2;
 
 unsigned long keepAliveNextCheck = 0;
-unsigned long redLEDNextCheck = 0;
-unsigned long yellowLEDNextCheck = 0;
-unsigned long greenLEDNextCheck = 0;
+
+int LEDBreathingState = 0;
+int LEDRedValue = 0;
+int LEDYellowValue = 0;
+int LEDGreenValue = 0;
 
 void setup() {
   Serial.begin(9600);

      tide(UP, val);
    } else if (command == "tidedown") {
      tide(DOWN, val);
    } else {
      Serial.println("Command not understood!");
    }


int counter = 0;

void updateLED() {
  float val = (exp(sin(now/2000.0*PI)) - 0.36787944)*108.0;
  if(LEDBreathingState & RED_MASK) {
    analogWrite(RED_PIN, val);
  }
  if(LEDBreathingState & YELLOW_MASK) {
    analogWrite(YELLOW_PIN, val);
  }
  if(LEDBreathingState & GREEN_MASK) {
    analogWrite(GREEN_PIN, val);
  }
}

void loop() {
  now = millis();
  if(now >= serialNextCheck) {
    checkSerial();
  }
