This page is also available in 2 other languages



Called at the end of loop() when data is available. Use to capture this data.

Please note: most modern boards do not support this method. See "Notes and Warnings" further below this article.


void serialEvent() {

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() {

void serialEvent2() {

void serialEvent3() {


statements: any valid statements



Notes and Warnings

Please note that serialEvent() does not work on any modern Arduino boards. The only recognized boards to have support as of 2023/12/06 are the UNO R3, Nano, Mega 2560 R3 and Due.

Instead, you can use the available() method. Examples in this page demonstrates how to read serial data only when it is available, similarly to how Serial.event() is implemented.

See also