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.
Diff: Command.h
- Revision:
- 0:4bc34a5fcc29
- Child:
- 1:13c4bf8989d5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Command.h Sat Nov 21 17:17:41 2015 +0000
@@ -0,0 +1,57 @@
+#pragma once
+#include <cstdint>
+
+class Command
+{
+public:
+ Command():_speed(0){}
+ Command(const Command&);
+ virtual ~Command(){}
+ virtual void execute() = 0;
+ void setSpeed(const std::int8_t& sp){_speed = sp;}
+
+protected:
+ float _speed;
+};
+
+class LedCommand : public Command
+{
+public:
+ LedCommand(){}
+ virtual void execute();
+};
+
+class TurnLeftCommand : public Command
+{
+public:
+ TurnLeftCommand(){}
+ virtual void execute();
+};
+
+class TurnRightCommand : public Command
+{
+public:
+ TurnRightCommand(){}
+ virtual void execute();
+};
+
+class MoveForwardCommand : public Command
+{
+public:
+ MoveForwardCommand(){}
+ virtual void execute();
+};
+
+class MoveBackwardCommand : public Command
+{
+public:
+ MoveBackwardCommand(){}
+ virtual void execute();
+};
+
+class StopCommand : public Command
+{
+public:
+ StopCommand(){}
+ virtual void execute();
+};