Description
Called at the end of loop()
when data is available. Use Serial.read()
to capture this data.
Please note: most modern boards do not support this method. See "Notes and Warnings" further below this article.
Syntax
void serialEvent() {
//statements
}
The Mega 2560 R3 and Due boards have additional serial ports which can be accessed by adding the corresponding number at the end of the function.
void serialEvent1() {
//statements
}
void serialEvent2() {
//statements
}
void serialEvent3() {
//statements
}
Parameters
statements
: any valid statements
Returns
Nothing