     else
         digitalWrite(color, LOW);
 }
+
+void ledControl(int led)
+{
+  if(led == 0)
+  {
+    digitalWrite(redLED, LOW);
+    digitalWrite(greenLED, LOW);
+    digitalWrite(blueLED, LOW);
+  }
+  else if(led == 1)
+  {
+    digitalWrite(redLED, HIGH);
+    digitalWrite(greenLED, LOW);
+    digitalWrite(blueLED, LOW);
+  }
+  else if(led == 2)
+  {
+    digitalWrite(redLED, LOW);
+    digitalWrite(greenLED, HIGH);
+    digitalWrite(blueLED, LOW);
+  }
+  else if(led == 3)
+  {
+    digitalWrite(redLED, LOW);
+    digitalWrite(greenLED, LOW);
+    digitalWrite(blueLED, HIGH);
+  }
+  else if(led == 4)
+  {
+    digitalWrite(redLED, HIGH);
+    digitalWrite(greenLED, HIGH);
+    digitalWrite(blueLED, LOW);
+  }
+  else if(led == 5)
+  {
+    digitalWrite(redLED, HIGH);
+    digitalWrite(greenLED, LOW);
+    digitalWrite(blueLED, HIGH);
+  }
+  else if(led == 6)
+  {
+    digitalWrite(redLED, LOW);
+    digitalWrite(greenLED, HIGH);
+    digitalWrite(blueLED, HIGH);
+  }
+  else if(led == 7)
+  {
+    digitalWrite(redLED, HIGH);
+    digitalWrite(greenLED, HIGH);
+    digitalWrite(blueLED, HIGH);
+  }
+  else   
+    Serial.println("Please enter a number between 0 and 7!!");
+}
+

      flashDotOrDash(redLED, false);
      flashDotOrDash(blueLED, false);
      flashDotOrDash(greenLED, false);
      Serial.print(" ");
    delay(trnsDELAY);       
  }
  Serial.println(); //for testing **************************************

  th_Val[0].r_t = ((float) r * thErrOFF);
  th_Val[0].g_t = ((float) g * thErrOFF);
  th_Val[0].b_t = ((float) b * thErrOFF);
<<<<<<< Updated upstream
  Serial.print("\nWaiting for threshold sequence");
=======
  Serial.print("\nWaiting for threshold sequence or type ");
  Serial.print(sync);
  Serial.println(" to send threshold sequence");
>>>>>>> Stashed changes
  uint16_t r_h, g_h, b_h;
  setupMain: //come back here untill sync seq start
  if (Serial.available() > 0) //if there is an input data
