[Serial]
描述
Returns the next byte (character) of incoming serial data without removing it from the internal serial buffer. That is, successive calls to peek()
will return the same character, as will the next call to read()
.
peek()
inherits from the Stream utility class.
語法
適用所有板子:
Serial.peek()
Serial1.peek()
適用 86Duino ONE:
Serial2.peek()
Serial3.peek()
Serial485.peek()
適用 86Duino EduCake:
Serial2.peek()
Serial3.peek()
Serial232.peek()
參數
None
回傳
the first byte of incoming serial data available (or -1 if no data is available) – int
參考
- if (Serial)
- available()
- begin()
- end()
- find()
- findUntil()
- flush()
- parseFloat()
- parseInt()
- print()
- println()
- read()
- readBytes()
- readBytesUntil()
- setTimeout()
- write()
- serialEvent()
語法參考主頁面
86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。