• Increase font size
  • Default font size
  • Decrease font size
  • default color
  • cyan color
  • red color

Arduino.TW樂園

Member Area
Arduino入門好簡單-語法篇(SerialRead)
站長Blog文章單元 - 入門教學(連接小電阻,光敏,五分鐘搞定的)
作者是 ken   
週一, 13 九月 2010 00:41

 int incomingByte = 0; // for incoming serial data

 
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
 
void loop() {
 
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
 
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}
附件:
下載此檔案 (SerialRead.pde.zip)SerialRead.pde.zip[ ]0 Kb西元2011年09月13日 00:43

blog comments powered by Disqus
最近更新在 週二, 13 九月 2011 01:19