serialEvent()

Description

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

Syntax

/*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
}

Parameters

statements : any valid statements

Returns

Nothing

Notes and Warnings

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.

See also