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.