serialEvent()

Description

Called when data is available. Use Serial.read() to capture this data.

serialEvent() functionality is not available on all Arduino boards or Serial interfaces:

Board Available serialEvent() functions
Uno
Nano
serialEvent()
Mega serialEvent()
serialEvent1()
serialEvent2()
serialEvent3()
Leonardo
Micro
Yún
serialEvent1()
Uno WiFi Rev2
Nano Every
None
MKR boards
Nano 33 IoT
Zero
None
Nano 33 BLE None
Portenta H7 None
Due serialEvent()
serialEvent1()
serialEvent2()
serialEvent3()
101 serialEvent1()

Syntax

void serialEvent() { //statements }

For boards with additional serial ports (see the list of available serial ports for each board on the Serial main page):

void serialEvent1() { //statements } void serialEvent2() { //statements } void serialEvent3() { //statements }

Parameter Values

  • statements: any valid statements

Return Values

  • Nothing

See Also

Please note: These are affiliate links. If you buy the components through these links, We may get a commission at no extra cost to you. We appreciate it.