Here is an example
I type: 0,1 (return)
serial characters Detected: got first number. got second number. .0, 1
That is what it SHOULD do, and sometimes does. then..
I type: 0,1 (return)
serial characters Detected: got first number.
then I type: 2 (return)
got second number. .0, 2
so it lost the "1" somehow
Here is the area of code I am dealing with:
Code: Select all
if (Serial.available() > 0) {
Serial.print (" serial characters Detected: ");
delay(50); //to give time for the serial buffer to fill
int fromFl = Serial.parseInt();
Serial.print ("got first number. ");
delay(50); //to give time for the serial buffer to fill
int toFl = Serial.parseInt();
Serial.print ("got second number. ");
while (Serial.available() > 0) {
Serial.print (".");
byte b = 0;
b = Serial.read();
}//MATT: flush the incomming serial buffer
Serial.print (fromFl);
Serial.print (", ");
Serial.println (toFl);
frame = fromFl;
stopFlag = false;
//set up floor chaning parameters here
break;
//}
}//end of serial available