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.