demo versie 16/05
Dependencies: EthernetInterface mbed-rto mbed
Fork of ProjectVLC by
Diff: Interpreter.h
- Revision:
- 75:31c15986b85e
- Parent:
- 31:915f6cb7ffa5
- Child:
- 77:6477a4fefa70
diff -r 939f51a1a223 -r 31c15986b85e Interpreter.h --- a/Interpreter.h Mon May 14 20:02:42 2018 +0000 +++ b/Interpreter.h Tue May 15 21:44:25 2018 +0000 @@ -3,13 +3,37 @@ #ifndef INTERPRETER_H #define INTERPRETER_H + + /** + * Class used to interpret text commands. + */ class Interpreter{ private: + /** + * Convert a direction such as left, right, up, down to the corresponding number (0, 1, 2 or 3). + * Invalid directions (or ignore) will return 4. + * @param command A character array representing the direction. + */ int directionToNumber(char* direction); Queue<int,8>* queue; int LED[8]; public: + + /** + * @param queue A pointer to the queue where the commands will be written. + */ Interpreter(Queue<int,8>* queue); + + /** + * Interprets a text command, and push the result on the queue. + * Syntax: + * The number of the LED + * Dash (-) + * The orientation (left,right,up,down or ignore). + * Multiple LEDS can be set up in one command, by using a whitespace. + * Example: 0-left 1-right 2-up + * @param command A character array representing the command. + */ void executeCommand(char* command); }; #endif \ No newline at end of file