如果你看得是比较旧版的Arduino的教材的话,一般都会写Serial.flush()是清空串口缓存。但是从Arduino 1.0起,这个指令的含义变了。如果你还需要清空串口缓存的话,可以使用:while(Serial.read()() >= 0)来代替。
Serial.flush()的变更可以参见Arduino的Release Note:
http://arduino.cc/en/Main/ReleaseNotes
the Serial.flush( ) command has been repurposed to wait for outgoing data to be transmitted, rather than dropping received incoming data.