easy xbee controller

Dependencies:   MultiSerial mbed

Revision:
0:a5b0ad1cf314
Child:
1:5c6ec036268e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Sep 04 04:52:34 2014 +0000
@@ -0,0 +1,34 @@
+//簡易コントローラー
+
+#include "mbed.h"
+#include "MultiSerial.h"
+
+#define KEYCODE 0xAA
+
+MultiSerial xbee(p28, p27,write);
+Serial pc(USBTX,USBRX);
+
+BusIn sw(p5,p6,p7,p8,p9,p10,p11,p12);
+
+BusOut check(LED1,LED2,LED3,LED4);
+
+uint8_t value[2]={0};
+uint8_t convert;
+
+int main(){
+    
+    xbee.write_data(value,KEYCODE);
+    
+    for(;;){
+        
+        sw.mode(PullUp);       
+        
+        convert = ~sw;
+        
+        value[0] = convert&0x0F;
+        value[1] = (convert&0xF0)>>4;
+        
+        check = value[0];
+        
+        }
+    }
\ No newline at end of file