if (Serial)



Indicates if the specified Serial port is ready.

On all 86Duino boards, if (Serial) indicates whether or not the USB CDC serial connection is open. For all other instances of real serial ports (UART), including if (Serial1), this will always returns true.


All boards:

  • if (Serial)
  • if (Serial1)

86Duino One specific:

  • if (Serial2)
  • if (Serial3)
  • if (Serial485)

86Duino EduCake specific:

  • if (Serial2)
  • if (Serial3)
  • if (Serial232)




boolean : returns true if the specified serial port is available. This will only return false if querying the USB CDC serial connection before it is ready.


void setup() {
 //Initialize serial and wait for port to open:
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
void loop() {
 //proceed normally

See also

Language Reference Home

The text of the 86Duino reference is a modification of the Arduino reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

Leave a Comment

Scroll to Top