 
 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();
-  float val;
   if(now >= serialNextCheck) {
     checkSerial();
   }

    Serial.println("I'm alive");
    keepAliveNextCheck = now + 2000;
  }
  val = (exp(sin(millis()/2000.0*PI)) - 0.36787944)*108.0;
  switch(counter % 3) {
    case 0:
      analogWrite(RED_PIN, val);
      break;
    case 1:
      analogWrite(YELLOW_PIN, val);
      break;
    case 2:
      analogWrite(GREEN_PIN, val);
      break;
  }

  if(val == 0) {
    //++counter;
    //delay(1);
  }
}


unsigned long servoDelay = 2;

unsigned long keepAliveNextCheck = 0;

int LEDBreathingState = 0;
int LEDRedValue = 0;
int LEDYellowValue = 0;
int LEDGreenValue = 0;

void setup() {
  Serial.begin(9600);
