(English) setTimeout()
描述
setTimeout()
可以設定接收串流資料的最大等待時間 (以毫秒為單位),超過這個時間沒有接收到任何資料,則判定為超時。預設值是 1 秒。
這個函式是 Stream 類別的一部分,它可以被任何繼承它的類別呼叫 (例如:Wire、Serial 等等) 。
語法
stream.setTimeout(time)
參數
stream
: 一個類別的實例,這個類別是繼承於 Stream
time
: 等待資料進來的最大時間 (單位:毫秒,long 型別)
回傳
無回傳值
See also
- Stream
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.