2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
18:526124eef0d1
Parent:
8:1638e8c8ca93
Child:
21:79b94cb922f0
Child:
27:287b93795472
--- a/communicate.h	Thu Sep 17 02:05:33 2015 +0000
+++ b/communicate.h	Thu Sep 17 02:58:36 2015 +0000
@@ -1,5 +1,6 @@
 /***RS485 Communication.***/
-
+#define RS485_TX p13
+#define RS485_RX p14
 Serial RS485(RS485_TX, RS485_RX);
 inline void sendData(int address, int data5) {
     unsigned int data;
@@ -10,13 +11,46 @@
 }
 
 /***Get state ps3con.***/
+#define SBDBT_TX p28
+#define SBDBT_RX p27
 Serial SBDBT(SBDBT_TX, SBDBT_RX);
 #define ps3_start 0x80
-short square=0,triangle=0,circle=0,cross=0,up=0,down=0,right=0,left=0,l1=0,l2=0,r1=0,r2=0;
-signed int analog_lx=0,analog_ly=0,analog_rx=0,analog_ry=0;
+short toggle            = 0;
+short edge_circle       = 0;
+short edge_triangle     = 0;
+short edge_r1           = 0;
+short edge_l1           = 0;
+short edge_l_up         = 0;
+short edge_l_down       = 0;
+short edge_r_up         = 0;
+short edge_r_down       = 0;
+short edge_right        = 0;
+short edge_left         = 0;
+short edge_up           = 0;
+short square            = 0;
+short triangle          = 0;
+short circle            = 0;
+short cross             = 0;
+short up                = 0;
+short down              = 0;
+short right             = 0;
+short left              = 0;
+short l1                = 0;
+short l2                = 0;
+short r1                = 0;
+short r2                = 0;
+signed int analog_lx    = 0;
+signed int analog_ly    = 0;
+signed int analog_rx    = 0;
+signed int analog_ry    = 0;
+int count               = 0;
+int sample              = 0;
 int ps3_data[7];
-int count=0;
-int sample=0;
+inline void data_clear();
+inline void data_check();
+inline void SBDBT_interrupt();
+inline void initializeSBDBT();
+
 inline void data_clear()
 {
     for(int i=0; i<7; i++) ps3_data[i]=0;