See also
-
EXAMPLE Serial Event
Called at the end of loop() when data is available. Use Serial.read() to capture this data.
/*F********************************************************************
*
**********************************************************************/
void
serialEvent()
{
//statements
}
For boards with additional serial ports (see the list of available serial ports for each board on the Serial main page ):
/*F********************************************************************
*
**********************************************************************/
void
serialEvent1()
{
//statements
}
/*F********************************************************************
*
**********************************************************************/
void
serialEvent2()
{
//statements
}
/*F********************************************************************
*
**********************************************************************/
void
serialEvent3()
{
//statements
}
statements : any valid statements
Nothing
serialEvent() doesn’t work on the Leonardo, Micro, or Yún.
serialEvent() and serialEvent1() don’t work on the Arduino SAMD Boards
serialEvent()
,
serialEvent1()
,
serialEvent2()
, and
serialEvent3()
don’t work on the Arduino Due.
EXAMPLE Serial Event