Skip to content

endLine()

CreateiveRobotics edited this page Mar 7, 2020 · 6 revisions
bool endLine()

Appends a newline to the buffer and processes it, returns true if the command was handled, this value can be ignored. This should be used when reading files to handle the final line of a file if it does not contain an end of line character.

Example: The update() function will return true if there are unread bytes in the file, and false when it reaches the end. endline() is called when the end of the file is reached so that any command on the last line will be appended with an end of line character and processed.

void readFile(){

  while(cmd.update()){delay(1);}

  cmd.endLine();

}
Clone this wiki locally