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

Revision:
8:e1da2ae62885
Parent:
6:98fe30430194
Child:
12:f485796016f8
--- a/commander.h	Mon Nov 16 18:46:31 2015 +0000
+++ b/commander.h	Mon Nov 16 22:20:11 2015 +0000
@@ -7,6 +7,11 @@
 #ifndef _commander_h_
 #define _commander_h_
 
+const int kMaxCommandCount = 10;
+enum CommandObjectRaw { InvalidObject = -1, MBED = 0, PC = 1, ColourSensor = 2, Servos = 3, Port = 4 };
+extern std::string CommandObjectValue [5];
+extern std::string CommandObjectCommandsValue [5][kMaxCommandCount];
+
 
 class Commander {
 public:
@@ -14,8 +19,11 @@
 	
 	CommandTypeRaw typeRaw;
 	char typeChar;
+	CommandObjectRaw objectRaw;
 	std::string object;
 	std::string command;
+	std::string commandValue;
+	int commandValueIndex;
 	
 	void decodeCommand(CommandTypeRaw type);
 	std::string description();
@@ -24,6 +32,9 @@
 	
 private:
 	void readCommandObject();
+	void readCommand(CommandObjectRaw objectRaw);
+	void executeCommand();
+	void resetVariables();
 };
 
-#endif
\ No newline at end of file
+#endif