       analogWrite(ledPin3,led3Value);
       led4Value += sign(out4-led4Value);
       int delayMS = 200;
-      if(mode == SLOW) delayMS = 1000;
+      if(mode == MODE_SLOW) delayMS = 1000;
       delayMicroseconds(delayMS * pow(timeMultiplier,1));
     }
   //  writeColor(102,255,0,60);
-  } else if(mode == AMBIENT_GREEN){
+  } else if (mode == MODE_GREEN){
     rawWriteColor(102,255,0,60);
-  } else if(mode == NIGHT_VISION){
+  } else if (mode == MODE_RED){
     rawWriteColor(255,0,0,100);
-  } else if(mode == WHITE){
+  } else if (mode == MODE_WHITE){
     rawWriteColor(255,255,255,100);
-  } else if(mode == SINGLE){  
-    while(abs(allLedValue-intensity)>1.0) {
+  } else if (mode == MODE_GREENPULSE){  
+    while (abs(allLedValue-intensity) > 1.0) {
       allLedValue += 0.4*sign(intensity-allLedValue);
       // writeColor(0,0,255,led1Value);
       rawWriteColor(102,255,0,allLedValue);

    if (digitalRead(2) == 1) return;
    Serial.print("");
  }
  mode++;
  if (mode > MODE_MAX) {
    mode = 0;
  }
  EEPROM.write(0, mode);
  rawWriteColor(0, 0, 0, 0);
  timer_start = micros();

    }
    Serial.println(out);
    lastUpdate = out;
  } else if (mode == MODE_OFF){
    rawWriteColor(0, 0, 0, 0);
  }
  // Serial.println("RNNING");
}
