Would it be better to write a small function to clear the buffer instead of doing serial.end/serial.begin as this may fragment memory.
void serialFlush(){
while(Serial.available() > 0) {
char t = Serial.read();
}
}
Would it be better to write a small function to clear the buffer instead of doing serial.end/serial.begin as this may fragment memory.
void serialFlush(){
while(Serial.available() > 0) {
char t = Serial.read();
}
}