RFID RFIDArduino 13LED const byte led Pin 13
使用RFID控制開關 採用兩個RFID標籤,一個當做「開」,另一個當做「關」,來控制Arduino 第 13腳的LED。 const byte led. Pin = 13; String tag. ON= "24850484853505649577052713"; String tag. OFF = "24854484855535452575356503"; void loop() { if (read. Tag()) { rfid. Str = ""; for (byte i=0; i<TAG_LEN; i++) { rfid. Str += temp[i]; } Serial. println(rfid. Str); if (rfid. Str == tag. ON) { digital. Write(led. Pin, HIGH); } else if (rfid. Str == tag. OFF) { digital. Write(led. Pin, LOW); } } } // 代表「開� 」 // 代表「關閉」 參閱 18 -14 // 點亮LED // 關閉LED
使用RFID進行Flash問答遊戲 遊戲的設定參數,位於quiz. xml檔。 import org. p 43 d. arduino. Arduino; import org. p 43 d. arduino. Arduino. Event; 參閱 18 -18 var a: Arduino = new Arduino(5331); a. add. Event. Listener(Arduino. Event. ON_RECEIVE_DATA, receive. Data); function receive. Data(e: Arduino. Event): void { var msg = e. data; // 讀取Arduino傳入的資料 trace(msg); } a. connect();
- Slides: 10