 void loop() {  
   serialThread.check();
   gradientThread.check();
+  flashThread.check();
   timeoutThread.check();
 }
 

  flashThread.reset();
  flashThread.enable();
  if (debugMode) {
    Serial.println("Flash setup done, gradient thread enabled.");
  }
}

void flash() {
  outputColor( flashFirstColor ? flashcol1 : flashcol2 );
  flashFirstColor = !flashFirstColor;
}

void timeoutAction() {
  
  if (debugMode) { Serial.println("Processing timeout."); }
  if (!recentActivity) {
    Serial.print("No recent activity for "); Serial.print(TIMEOUT); Serial.println(" seconds.");


void processColor() {
  gradientThread.disable(); // cut off anything else
  flashThread.disable();
  gradientLoop = false;
  char colorInput[8];
  arrayCopy(colorInput,&inputBuffer[1],7);
