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:
5:c1b3251ba5d5
Parent:
2:d77f669c7feb
Child:
6:7a38f754e030
--- a/main.cpp	Sun Nov 22 03:25:01 2015 +0000
+++ b/main.cpp	Sat Nov 28 01:02:09 2015 +0000
@@ -2,23 +2,29 @@
 #include "mbed.h"
 #include "CommandPool.h"
 #include "Xbee.h"
+#include "GenCMD.h"
 
 Command* cmd;
 CommandPool pool;
-char CMD = MOVE_FORWARD;
+GenCMD gen_cmd;
+Xbee xbee(p9,p10,p11);
+
+char cmd_buffer[3];  //LED;
 
 
 int main()
 {
     /* draft of main code*/
     pool.init();
+    gen_cmd.init();
 
     while(1)
     {
+        gen_cmd.GenerateCMD(cmd_buffer);
         //if(med1.readable())
         //{
             //med1.read(cmd_buffer,20,callBack);            // read to cmd buffer, and update command
-            cmd = pool.getCommand(CMD);              // if cmd is valid
+            //cmd = pool.getCommand(cmd_buffer);              // if cmd is valid
             if(cmd)
             {
                 cmd->execute();                             // execute cmd