LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
LRTServo.h
1 #ifndef LRT_SERVO_H_
2 #define LRT_SERVO_H_
3 
4 #include "Servo.h"
5 #include "Actuator.h"
6 #include "../Logging/Loggable.h"
7 
11 class LRTServo : public Servo, public Actuator, public Loggable
12 {
13 public:
14  typedef enum
15  {
16  kValue, kMicroseconds, kAngle
17  } ControlMode;
18 
19  LRTServo(UINT32 channel, std::string name);
20  ~LRTServo();
21 
22  void Output();
23 
24  void SetEnabled(bool enabled);
25  bool IsEnabled();
26 
27  void Set(float value);
28  void SetAngle(float angle);
29  void SetMicroseconds(int ms);
30  void SetControlMode(ControlMode mode);
31 
32  float Get();
33  float GetHardwareValue();
34  ControlMode GetControlMode();
35 
36  void Log();
37 
38  void Send();
39 
40 private:
41  ControlMode m_controlMode;
42  float m_value;
43  bool enabled;
44  float previous_value;
45 
46  static const int MIN_VAL = 727;
47  static const int MAX_VAL = 2252;
48 };
49 
50 #endif