![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
3rd year group project. Electronic and Electrical Engineering. Heriot-Watt University. This is the code for the mbed for the Automatic Little Object Organiser (ALOO).
Dependencies: MCP23017 TCS3472_I2C WattBob_TextLCD mbed
Diff: commander.h
- Revision:
- 24:02c61793f90b
- Parent:
- 23:db91aaa43a9e
- Child:
- 32:9a4046224b11
--- a/commander.h Sat Nov 28 23:28:22 2015 +0000 +++ b/commander.h Sun Nov 29 01:05:42 2015 +0000 @@ -9,33 +9,33 @@ const int kMaxCommandCount = 10; enum CommandObjectRaw { InvalidObject = -1, MBED = 0, PC = 1, ColourSensor = 2, Servos = 3, Port = 4, BreakBeam = 5 }; -extern std::string CommandObjectValue [5]; -extern std::string CommandObjectCommandsValue [5][kMaxCommandCount]; +extern std::string CommandObjectValue [6]; +extern std::string CommandObjectCommandsValue [6][kMaxCommandCount]; -class Commander { -public: - Commander(); - - CommandTypeRaw typeRaw; - char typeChar; - CommandObjectRaw objectRaw; - std::string object; - std::string command[kMaxCommandCount - 1]; - std::string commandValue[kMaxCommandCount - 1]; - int commandIndex[kMaxCommandCount -1]; +class Commander { +public: + Commander(); + + CommandTypeRaw typeRaw; + char typeChar; + CommandObjectRaw objectRaw; + std::string object; + std::string command[kMaxCommandCount - 1]; + std::string commandValue[kMaxCommandCount - 1]; + int commandIndex[kMaxCommandCount -1]; bool replyCommands; - - void decodeCommand(CommandTypeRaw type); - std::string description(); - - virtual ~Commander(); - -private: - void readCommandObject(); - bool readCommand(CommandObjectRaw objectRaw); - void executeCommand(); - void resetVariables(); + + void decodeCommand(CommandTypeRaw type); + std::string description(); + + virtual ~Commander(); + +private: + void readCommandObject(); + bool readCommand(CommandObjectRaw objectRaw); + void executeCommand(); + void resetVariables(); }; #endif