SoftwareSerial: overflow()

[SoftwareSerial]

説明

Tests to see if a software serial buffer overflow has occurred. Calling this function clears the overflow flag, meaning that subsequent calls will return false unless another byte of data has been received and discarded in the meantime.

The software serial buffer can hold 64 bytes.

構文

// set up a new serial port
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);

mySerial.overflow()

媒介変数

none

戻り値

boolean

#include <SoftwareSerial.h>
 
// software serial : TX = digital pin 10, RX = digital pin 11
SoftwareSerial portOne(10,11);
 
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!"); 
}

参照


ライブラリリファレンスホーム

86Duinoリファレンスのテキストは、Arduinoリファレンスを改変したもので、Creative Commons Attribution-ShareAlike 3.0ライセンスに基づいてライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。

上部へスクロール