Click here to Skip to main content
15,905,508 members

Comments by Member 14884114 (Top 1 by date)

Member 14884114 8-Jul-20 9:21am View    
actually the arduino code have this function to do exactly what you say :

void serialEvent() {
while (Serial.available()) {
// get the new byte:
char inChar = (char)Serial.read();
// add it to the inputString:
if (inChar != '\n') {
mySt += inChar;
}
// if the incoming character is a newline, set a flag
// so the main loop can do something about it:
if (inChar == '\n') {
stringComplete = true;
}
}