Xiaofei Qiu / Mbed 2 deprecated Robot_and_Controller

Dependencies:   Command CommandPool GenCMD LSM9DS0 Mode Motor PinDetect Xbee mbed

Fork of VR_Robot by Xiaofei Qiu

Revision:
6:7a38f754e030
Parent:
5:c1b3251ba5d5
Child:
7:348c8891e542
diff -r c1b3251ba5d5 -r 7a38f754e030 main.cpp
--- a/main.cpp	Sat Nov 28 01:02:09 2015 +0000
+++ b/main.cpp	Sat Nov 28 02:35:43 2015 +0000
@@ -8,10 +8,13 @@
 CommandPool pool;
 GenCMD gen_cmd;
 Xbee xbee(p9,p10,p11);
+DigitalOut led(LED1);
 
-char cmd_buffer[3];  //LED;
+char cmd_buffer[3];
 
 
+Serial pc(USBTX, USBRX);
+
 int main()
 {
     /* draft of main code*/
@@ -21,15 +24,17 @@
     while(1)
     {
         gen_cmd.GenerateCMD(cmd_buffer);
+        xbee.Send(cmd_buffer);
+        led = !led;
         //if(med1.readable())
         //{
             //med1.read(cmd_buffer,20,callBack);            // read to cmd buffer, and update command
             //cmd = pool.getCommand(cmd_buffer);              // if cmd is valid
-            if(cmd)
-            {
-                cmd->execute();                             // execute cmd
-            }               
-            wait(0.5);  
+            //if(cmd)
+            //{
+                //cmd->execute();                             // execute cmd
+            //}               
+            wait(0.01);  
         //}
     } 
  return 0;