first

Dependencies:   BEAR_Reciever Motor eeprom iSerial mbed

Fork of BEAR_Motion by BE@R lab

Revision:
17:4c96838e579f
Parent:
16:c0a1daeb9fa5
Child:
18:face01c94152
--- a/main.cpp	Fri Jan 22 19:23:59 2016 +0000
+++ b/main.cpp	Sun Jan 24 07:57:55 2016 +0000
@@ -26,7 +26,7 @@
 Ticker Recieve;
 //-- Communication --
 Serial PC(D1,D0);
-Bear_Receiver com(Tx,Rx,115200);
+Bear_Receiver com(Tx,Rx,1000000);
 int16_t MY_ID = 0x01;
 //-- Memorry --
 EEPROM memory(PB_4,PA_8,0);
@@ -314,7 +314,7 @@
                     }
                     // unfinish yet!!!!!!!!!!!!!!!!!
                     case SAVE_EEPROM_DATA: {
-                        if (cmd[1]==0){
+                        if (cmd[1]==ID){
                         
                         }
                     }
@@ -363,6 +363,7 @@
         }
     }
 }
+
 /******************************************************/
 void Start_Up()
 {
@@ -381,7 +382,7 @@
 /*******************************************************/
 void Rc()
 {
-    uint8_t data_array[10];
+    uint8_t data_array[30];
     uint8_t id;
     uint8_t ins;
 
@@ -391,7 +392,11 @@
 /*******************************************************/
 int main()
 {
-    Recieve.attach(&Rc,0.2);
+    while(1)
+    {
+        Rc();
+        }
+    /*Recieve.attach(&Rc,0.000001);
     Start_Up();
     SET_UpperPID();
     SET_LowerPID();
@@ -404,7 +409,7 @@
         //Control Motor
         Move_Upper();
         Move_Lower();
-    }
+    }*/
 }