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.