parseInt()

描述

从外部进来的序列资料中,找到下一个可用的整数。parseInt() 是继承于 Stream 类别。

假如在 1 秒内没有找到可用的整数 (时间可以透过 Serial.setTimeout() 来调整),则回传 0。

语法

适用所有板子:

Serial.parseInt()
Serial1.parseInt()

适用 86Duino ONE:

Serial2.parseInt()
Serial3.parseInt()
Serial485.parseInt()

适用 86Duino EduCake:

Serial2.parseInt()
Serial3.parseInt()
Serial232.parseInt()

参数

回传

int : 下一个可用的整数

See also

Serial
available()
begin()
end()
find()
findUntil()
flush()
parseFloat()
peek()
print()
println()
read()
readBytes()
readBytesUntil()
setTimeout()
write()
serialEvent()


语法参考主页面

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.