Now you can download a copy of these docs so you can use them offline! Download now
Servo.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2008. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5 /*----------------------------------------------------------------------------*/
6 
7 #ifndef SERVO_H
8 #define SERVO_H
9 
10 #include "SafePWM.h"
11 #include "SpeedController.h"
12 
19 class Servo : public SafePWM
20 {
21 public:
22  explicit Servo(uint32_t channel);
23  Servo(uint8_t moduleNumber, uint32_t channel);
24  virtual ~Servo();
25  void Set(float value);
26  void SetOffline();
27  float Get();
28  void SetAngle(float angle);
29  float GetAngle();
30  static float GetMaxAngle() { return kMaxServoAngle; };
31  static float GetMinAngle() { return kMinServoAngle; };
32 
33  void ValueChanged(ITable* source, const std::string& key, EntryValue value, bool isNew);
34  void UpdateTable();
35  void StartLiveWindowMode();
36  void StopLiveWindowMode();
37  std::string GetSmartDashboardType();
38  void InitTable(ITable *subTable);
39  ITable * GetTable();
40 
41  ITable *m_table;
42 
43 private:
44  void InitServo();
45  float GetServoAngleRange() {return kMaxServoAngle - kMinServoAngle;}
46 
47  static constexpr float kMaxServoAngle = 170.0;
48  static constexpr float kMinServoAngle = 0.0;
49 };
50 
51 #endif
52 
Servo(uint32_t channel)
Definition: Servo.cpp:37
Definition: ITable.h:26
void ValueChanged(ITable *source, const std::string &key, EntryValue value, bool isNew)
Definition: Servo.cpp:126
void StopLiveWindowMode()
Definition: Servo.cpp:142
void InitTable(ITable *subTable)
Definition: Servo.cpp:152
void SetAngle(float angle)
Definition: Servo.cpp:101
void Set(float value)
Definition: Servo.cpp:64
ITable * GetTable()
Definition: Servo.cpp:157
void SetOffline()
Definition: Servo.cpp:74
void StartLiveWindowMode()
Definition: Servo.cpp:136
Definition: Servo.h:19
float Get()
Definition: Servo.cpp:85
void UpdateTable()
Definition: Servo.cpp:130
std::string GetSmartDashboardType()
Definition: Servo.cpp:148
float GetAngle()
Definition: Servo.cpp:121
Definition: ITable.h:13

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6