Xiaofei Qiu / Command
Revision:
7:3dee2b884e1f
Parent:
4:3fbe2d75f7eb
Child:
8:0752270a196e
diff -r bbaabcc5206d -r 3dee2b884e1f Command.h
--- 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;
 };