Xbee API test program

Dependencies:   C12832_lcd mbed

Files at this revision

API Documentation at this revision

Comitter:
khayakawa
Date:
Sun Jun 02 01:43:33 2013 +0000
Child:
1:0488555c7ef0
Commit message:
This program shows Xbee API packet on teraterm.

Changed in this revision

C12832_lcd.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832_lcd.lib	Sun Jun 02 01:43:33 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/C12832_lcd/#468cdccff7af
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Jun 02 01:43:33 2013 +0000
@@ -0,0 +1,41 @@
+/* PC=end divce, mbed=cordinator */
+/* type key on a PC connected with Xbee end device, */
+/* display key on LCD of cordinator */ 
+
+#include "mbed.h"
+#include "C12832_lcd.h"
+
+Serial pc(USBTX, USBRX); // tx, rx
+Serial device(p9, p10);  // tx, rx
+C12832_LCD lcd;
+DigitalOut myled(LED1);
+char* ch[16]={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};
+
+void dev_rx () {
+    char val;
+    int tmp1,tmp2;
+    
+    myled=1;
+    val=device.getc();
+    lcd.printf("%x ",val);
+    tmp1 = val/16;
+    tmp2 = val%16;
+    pc.printf("%s%s",ch[tmp1],ch[tmp2]);
+  //  wait(.2);
+    myled=0;
+    
+    
+}
+
+int main() {
+device.printf("Hello World!");
+
+    lcd.cls();
+    lcd.locate(0,0);
+    myled=0;
+    
+    device.attach(&dev_rx, Serial::RxIrq);
+    //device.attach(dev_rx, RxIrq);
+    
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Jun 02 01:43:33 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file