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:
- 7:3dee2b884e1f
- Parent:
- 4:3fbe2d75f7eb
- Child:
- 8:0752270a196e
--- a/Command.h Sat Nov 28 19:49:22 2015 +0000
+++ b/Command.h Sat Nov 28 23:11:53 2015 +0000
@@ -1,17 +1,28 @@
#pragma once
#include <cstdint>
+/** Command class.
+ * Author Xiaofei Qiu
+ */
class Command
{
public:
Command();
+
Command(const Command&);
+
virtual ~Command(){}
+
+ /** Uses vitual function for dynamic binding */
virtual void execute() = 0;
- void setSpeed(const std::int8_t& sp=0.5, const std::int8_t& is_negative = 0);
+
+ /** Sets Speed, if is_negative is true, then speed will be negative. otherwaise, speed is position */
+ void setSpeed(const std::int8_t& sp, const std::int8_t& is_negative = 0);
protected:
float _SPEED;
+
+ /** Direction of the motor speed */
bool _IS_NEGATIVE;
};