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.cpp
- Revision:
- 27:2cb1bdb7ae3d
- Parent:
- 25:792540d69c49
- Child:
- 28:7e4d29977d72
--- a/commander.cpp Mon Nov 30 21:29:51 2015 +0000 +++ b/commander.cpp Tue Dec 01 16:16:26 2015 +0000 @@ -14,7 +14,7 @@ string CommandObjectValue [6] = { "mbed", "pc", "colour_sensor", "servos", "port", "break_beam" }; string CommandObjectCommandsValue [6][kMaxCommandCount] = { - {"mbed", "haz-block", "read-current-block", "mode", "sort", "", "", "", "", ""}, + {"mbed", "haz-block", "read-current-block", "mode", "sort", "reading-count", "", "", "", ""}, {"pc", "connect", "disconnect", "", "", "", "", "", "reply-commands", "exit"}, {"colour_sensor", "i-time", "preview", "value", "block-value", "test", "", "", "", ""}, {"servos", "test", "reset", "toggle", "", "", "", "", "", ""}, @@ -219,6 +219,10 @@ currentState = Pause; pc.printf("INFO:Pausing sorting.\n"); } + } else if (this->commandIndex[i] == 5){ + int readingCount = 0; + sscanf(this->commandValue[i].c_str(), "%i", readingCount); + hazReadingCount = readingCount; } } break;