   } 
   delay(setupWaitTime);
   //set threshold for green high
-  th_Val[2].r_t = (r * thErrOFF); 
-  th_Val[2].g_t = (g * thErrON);
-  th_Val[2].b_t = (b * thErrOFF);
+  th_Val[2].r_t = ((float) r * thErrOFF); 
+  th_Val[2].g_t = ((float) g * thErrON);
+  th_Val[2].b_t = ((float) b * thErrOFF);
   while(g > th_Val[0].g_t) //wait until green is LOW
   {
     tcs.getRawData(&r, &g, &b, &c); 

    delay(initDelay);
    digitalWrite(redLED, LOW);
    digitalWrite(greenLED, LOW);
    digitalWrite(blueLED, LOW);
    delay(initDelay);
    
}

void flashDotOrDash(int color, bool dotOrDash)

  Serial.print("Getting threshold values");
  Serial.print(".");
  //set threshold for red HIGH
  th_Val[1].r_t = ((float) r * thErrON); 
  th_Val[1].g_t = ((float) g * thErrOFF);
  th_Val[1].b_t = ((float) b * thErrOFF);
  while(r > th_Val[0].r_t) //wait until red is LOW
  {
    tcs.getRawData(&r, &g, &b, &c); //get env info
