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

main.cpp

Committer:
Xiaofei
Date:
2015-11-21
Revision:
0:526a865b9b03
Child:
2:d77f669c7feb

File content as of revision 0:526a865b9b03:

#include "mbed.h"
#include "CommandPool.h"

/*  draft code

    Serial med1(ptx,prx);   // used for read data from another mbed
    
    Command* cmd;           
    
    char cmd_buffer[20];    // data buffer 
    CommandPool pool;
    
    void callBack()         // when cmd_buffer obtained something, update cmd
    {
        cmd = pool.getCommand(cmd_buffer);
    }

*/


Command* cmd;
CommandPool pool;
char CMD = LED;
Serial pc(USBTX,USBRX);

int main()
{
    /* draft of main code*/
    pool.init();
    
    while(1)
    {
        //if(med1.readable())
        //{
            //med1.read(cmd_buffer,20,callBack);            // read to cmd buffer, and update command
            cmd = pool.getCommand(CMD);              // if cmd is valid
            if(cmd)
            {
                cmd->execute();                             // execute cmd
            }               
            wait(0.5);  
        //}
    } 
 return 0;
}