Hajime Muraki
/
program_SensorBlock
sensor
Fork of program_SensorBlock by
Diff: usart.cpp
- Revision:
- 3:7de2c50339bd
- Parent:
- 1:3ecb80796a7f
- Child:
- 6:97015325107b
--- a/usart.cpp Mon Feb 24 05:23:18 2014 +0000 +++ b/usart.cpp Mon Feb 24 07:05:48 2014 +0000 @@ -3,7 +3,7 @@ #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]^tx_data[9]^tx_data[10]) #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]^rx_data[9]^rx_data[10]) -#define DATA_NUM 13 +#define DATA_NUM 14 #define CHECK (DATA_NUM - 1) #define ALL_IR 10 #define ALL_PING 4 @@ -18,7 +18,7 @@ extern unsigned int value_ir_min; extern unsigned int ir_min_num; extern unsigned int value_line[ALL_LINE]; -extern unsigned int value_compass; +extern unsigned int value_compass[2]; void micon_rx(){ static uint8_t rx; @@ -56,8 +56,9 @@ tx_data[8] = value_line[1]; tx_data[9] = value_line[2]; tx_data[10] = value_line[3]; - tx_data[11] = value_compass; - tx_data[12] = TX_CHECKCODE; + tx_data[11] = value_compass[0]; + tx_data[12] = value_compass[1]; + tx_data[13] = TX_CHECKCODE; tx = 0; }