main

Dependencies:   TextLCD mbed PID

Revision:
4:536cd493a337
Parent:
3:440e774cc24b
Child:
5:6604ec9044a0
diff -r 440e774cc24b -r 536cd493a337 usart.cpp
--- a/usart.cpp	Wed Mar 12 04:51:30 2014 +0000
+++ b/usart.cpp	Mon Mar 17 05:41:07 2014 +0000
@@ -4,11 +4,12 @@
 #define KEYCODE 0xAA
 #define TX_CHECKCODE (tx_data[1]^tx_data[2]^tx_data[3]^tx_data[4]^tx_data[5]^tx_data[6]^tx_data[7]^tx_data[8])
 #define RX_CHECKCODE (rx_data[1]^rx_data[2]^rx_data[3]^rx_data[4]^rx_data[5]^rx_data[6]^rx_data[7]^rx_data[8])
-#define DATA_NUM 12
+#define DATA_NUM 11
 #define CHECK (DATA_NUM - 1)
-#define ALL_IR 12
+#define ALL_IR 11
 
 
+extern Serial xbee;
 extern Serial sensor;
 extern Serial pc;
 
@@ -18,6 +19,14 @@
 extern uint8_t ir_max, ir_num;
 extern int compass;
 
+void xbee_tx(){
+    
+}
+
+void xbee_rx(){
+    
+}
+
 void micon_rx(){
     
     static uint8_t rx;
@@ -39,7 +48,7 @@
             ping[RIGHT] = rx_data[6];
             compass = rx_data[7] + rx_data[8];
             ir_dis = rx_data[9];
-            ball_on = rx_data[10];
+            //ball_on = rx_data[10];
 /*            line[FRONT] = rx_data[7];
             line[LEFT] = rx_data[8];
             line[BACK] = rx_data[9];
@@ -49,7 +58,7 @@
             //pc.printf("%d %d %d %d\n", rx_data[3], rx_data[4], rx_data[5], rx_data[6]);
             //pc.printf("%d %d %d %d\n", rx_data[7], rx_data[8], rx_data[9], rx_data[10]);
             //pc.printf("%d %d %d\n", rx_data[7], rx_data[8], compass);
-            //pc.printf("%d\n", rx_data[9]);
+            //pc.printf("%d\n", rx_data[7]);
             //pc.printf("%d\t%d\t%d\t%d\n", ping[FRONT], ping[LEFT], ping[BACK], ping[RIGHT]);
             //pc.printf("%d %d  %d\n", ping[LEFT], ping[RIGHT], ping[LEFT] + ping[RIGHT]);
             //pc.printf("%d\t%d\t%d\t%d\n", ir_dis, ball_on, value_ir, ir_num);