Reference   Language | Libraries | Comparison | Changes

SoftwareSerial: overflow()

Description

Tests to see if a software serial buffer overflow has occurred. A software serial buffer can hold 64 bytes.

Syntax

mySerial.overflow()

Parameters

none

Returns

boolean

Example

#include <SoftwareSerial.h>

// software serial : TX = digital pin 2, RX = digital pin 3
SoftwareSerial portOne(2, 3);

void setup()
{
  // Start the hardware serial port
  Serial.begin(9600);

  // Start software serial port
  portOne.begin(9600);
}

void loop()
{
  if (portOne.overflow()) {
   Serial.println("SoftwareSerial overflow!");
}

See also

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

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