main

Dependencies:   TextLCD mbed PID

Revision:
5:6604ec9044a0
Parent:
4:536cd493a337
diff -r 536cd493a337 -r 6604ec9044a0 usart.cpp
--- a/usart.cpp	Mon Mar 17 05:41:07 2014 +0000
+++ b/usart.cpp	Mon Mar 17 06:37:37 2014 +0000
@@ -12,6 +12,7 @@
 extern Serial xbee;
 extern Serial sensor;
 extern Serial pc;
+extern DigitalOut myled[4];
 
 extern uint8_t value_ir, ir_num, ir_dis, ball_on;
 extern uint8_t ping[4];
@@ -19,12 +20,18 @@
 extern uint8_t ir_max, ir_num;
 extern int compass;
 
+int count = 0;
 void xbee_tx(){
-    
+    xbee.putc(1);
 }
 
 void xbee_rx(){
-    
+    if(xbee.readable()){
+        count = xbee.getc();
+    } else {
+        count = 0;
+    }
+    //pc.printf("%d\n", count);
 }
 
 void micon_rx(){