serialEvent()

描述

缓冲区内有可用资料时会被呼叫的 callback 函式。你可以在这个函式内用 Serial.read() 来取得缓冲区内的资料。

语法

适用所有板子:

void serialEvent(){
   //statements
}

void serialEvent1(){
   //statements
}

适用 86Duino ONE:

void serialEvent2(){
   //statements
}

void serialEvent3(){
   //statements
}

void serialEvent485(){
   //statements
}

适用 86Duino EduCake:

void serialEvent2(){
   //statements
}

void serialEvent3(){
   //statements
}

void serialEvent232(){
   //statements
}

参数

statements: 任何可用的程式码

See also

- SerialEvent Tutorial from the Arduino Examples
- Serial
- available()
- begin()
- end()
- find()
- findUntil()
- flush()
- parseFloat()
- parseInt()
- peek()
- print()
- println()
- read()
- readBytes()
- readBytesUntil()
- setTimeout()
- write()


语法参考主页面

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.