Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ROME2_P3 by
Diff: StateMachine.h
- Revision:
- 5:59079b76ac7f
- Parent:
- 0:e360940c4b88
- Child:
- 6:67263dc2c2cf
--- a/StateMachine.h Thu Apr 12 12:19:19 2018 +0000 +++ b/StateMachine.h Thu Apr 12 14:56:27 2018 +0000 @@ -8,9 +8,13 @@ #define STATE_MACHINE_H_ #include <cstdlib> +#include <deque> #include <mbed.h> #include "Controller.h" #include "IRSensor.h" +#include "Task.h" +#include "TaskWait.h" +#include "TaskMoveTo.h" /** * This class implements a simple state machine for a mobile robot. @@ -22,8 +26,8 @@ public: - static const int ROBOT_OFF = 0; // discrete states of this state machine - static const int MOVE_FORWARD = 1; + static const int ROBOT_OFF = 0; // discrete states of this state machine + static const int PROCESSING_TASKS = 1; static const int TURN_LEFT = 2; static const int TURN_RIGHT = 3; static const int SLOWING_DOWN = 4; @@ -57,10 +61,10 @@ int state; int buttonNow; int buttonBefore; + deque<Task*> taskList; Ticker ticker; void run(); }; #endif /* STATE_MACHINE_H_ */ -