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:
17:af373246bf80
Parent:
16:4a41cb9e525f
Child:
18:44a1c1a30166
--- a/commander.cpp	Sun Nov 22 21:23:09 2015 +0000
+++ b/commander.cpp	Mon Nov 23 23:13:39 2015 +0000
@@ -14,11 +14,11 @@
 
 string CommandObjectValue [5] = { "mbed", "pc", "colour_sensor", "servos", "port" };
 string CommandObjectCommandsValue [5][kMaxCommandCount] = {
-    {"mbed", "haz-block", "read-current-block", "mode", "", "", "", "", "", ""},
+    {"mbed", "haz-block", "read-current-block", "mode", "sort", "", "", "", "", ""},
     {"pc", "connect", "disconnect", "", "", "", "", "", "reply-commands", "exit"},
     {"colour_sensor", "i-time", "preview", "", "", "", "", "", "", ""},
-    {"servos", "test", "reset", "", "", "", "", "", "", ""},
-    {"port", "init", "b-rate", "parity", "", "", "", "", "", ""},
+    {"servos", "test", "reset", "stop-test", "", "", "", "", "", ""},
+    {"port", "init", "b-rate", "parity", "", "", "", "", "", ""}
 };
 
 Commander::Commander()
@@ -50,8 +50,8 @@
         return;
     } else if (connectedToPC == true || (this->typeRaw == Set && this->objectRaw == PC && this->commandIndex[0] == 1)) {
         this->executeCommand();
-        if (this->replyCommands) {
-            this->description();
+        if (this->replyCommands == true) {
+            pc.printf("%s", this->description().c_str());
         }
         return;
     }
@@ -199,8 +199,10 @@
                     getCurrentBlock(this->typeRaw);
                 } else if (this->commandIndex[i] == 3) {
                     if (this->commandValue[i] == "maintanence") {
-
-                    }
+						currentMode = Maintanence;
+                    }else if (this->commandValue[i] == "normal"){
+                    	currentMode = Normal;
+                	}
                 }
             }
             break;
@@ -216,7 +218,9 @@
                 } else if (this->commandIndex[i] == 8) {
                     if (this->commandValue[i] == "ON") {
                         this->replyCommands = true;
-                    } else if (this->commandValue[i] == "OFF") this->replyCommands = false;
+                    } else if (this->commandValue[i] == "OFF") {
+                        this->replyCommands = false;
+                    }
                 }
             }
             break;
@@ -250,9 +254,15 @@
                     break;
                 }
                 if (this->commandIndex[i] == 1) {
-                    testServos();
+                    if (this->commandValue[i] == "start") {
+                        testServos(Start);
+                    } else if (this->commandValue[i] == "pause") {
+                        testServos(Pause);
+                    }
                 } else if (this->commandIndex[i] == 2) {
                     resetServos();
+                } else if (this->commandIndex[i] == 3) {
+
                 }
             }
             break;