SoftwareSerial: read

描述

回傳軟體序列介面接收到的資料。

請注意,同一時間只能有一個 SoftwareSerial 物件接收資料,監聽指定 SoftwareSerial 物件請呼叫 listen()

參數

無參數

回傳

char:回傳軟體序列介面接收到的資料中最先收到的字元,如果沒有資料可以讀則回傳 -1

範例

SoftwareSerial mySerial(10,11);

void setup()
{
  mySerial.begin(9600);
}

void loop()
{
  char c = mySerial.read();
}

See also

SoftwareSerial()
begin()
print()
println()


函式庫參考主頁面

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.