Hello!
I am trying to make a simple data receiver but i am stuck here any help is appreciated.
void setup() {
Serial.begin(9600);
}
void loop() {
in_Parser();
}
void in_Parser(){
static byte in_packet = byte(252);
if (Serial.available() > 0){
byte _in = Serial.read();
if (_in == in_packet){
Serial_test();
return;
}
}
}
void Serial_test(){
Serial.println("Here");
while (Serial.available() > 0){
byte in = Serial.read();
Serial.println(in);
}
}
What i cannot understand is that why doesn't the while loop in the Serial_test function take over in reading the serial buffer.