2015_robocon_bteam / Mbed 2 deprecated 2015robot_main_zenkoku

Dependencies:   PID QEI mbed

Revision:
5:0e6dd1ff3ff2
Parent:
0:b613dc16f27d
Child:
11:565fca1ead5b
--- a/communicate.h	Sat Oct 31 05:08:25 2015 +0000
+++ b/communicate.h	Sat Oct 31 09:03:47 2015 +0000
@@ -4,8 +4,20 @@
 Serial RS485(RS485_TX, RS485_RX);
 #define EnablePin p7
 DigitalOut Enable(EnablePin);
+#define myaddress 8
+
+/*void getData(){
+    int gdata, endBit, addressBit;
+    gdata       = RS485.getc();
+    addressBit  = (gdata >> 4) & 0b00000111;
+    if (addressBit == myaddress) {
+        dataBit =(gdata & 0b00001111);
+    }
+}*/
+
 inline void initializeRS485(){
     RS485.format(8,Serial::Even);
+//    RS485.attach(getData,Serial::RxIrq);
 }
 
 /*
@@ -43,7 +55,7 @@
 int deadCOUNT = 0;
 int deadflag = 0;
 int oldDATA;
-unsigned int cm, a2, b, X, Y;
+unsigned int cm, a2, b, X=5, Y=5;
 unsigned int sendDATA = 0;
 unsigned long outDATA[4];