Also, the semi-colon after the while statement is what the while loop "sees" as the loop body. remove it.
Good catch.
A couple of improvements:
int TX_FLASH(int time)
{
digitalWrite(TX_LED, HIGH); //turn on TX_LED
delay(time); //wait TIME
digitalWrite(TX_LED, LOW); //turn off TX_LED
}
int RX_FLASH(int time)
{
digitalWrite(RX_LED, HIGH); //turn on RX_LED
delay(time); //wait TIME
digitalWrite(RX_LED, LOW); //turn off RX_LED
}
int LC_FLASH(int time)
{
digitalWrite(LC_LED, HIGH); //turn on LC_LED
delay(time); //wait TIME
digitalWrite(LC_LED, LOW); //turn off LC_LED
}
Can be reduced to:
void FLASH_SOMETHING(int led, unisgned long time)
{
digitalWrite(led, HIGH);
delay(time); //wait TIME
digitalWrite(led, LOW);
}
if (compread > 48)
I gather you aren't sending it 48, you're sending it '1', '2', '3', etc.? Functionally it's the same, but this is more clear as to your intentions:
if (compread > '0')
count = count + 1;
The language is called C++. Feel free to use such operator:
count++;