Studica - C++ Documentation
Servo.h
1 #pragma once
2 
3 #include <frc/PWM.h>
4 #include <frc/SpeedController.h>
5 
6 namespace studica {
7  class Servo;
8 }
9 
10 class studica::Servo : public frc::PWM {
11  public:
12 
13  explicit Servo(int channel);
14  Servo(Servo&&) = default;
15  Servo& operator=(Servo&&) = default;
16 
17  void Set(double value);
18  void SetOffline();
19  double Get() const;
20  void SetAngle(double angle);
21  double GetAngle() const;
22  double GetMaxAngle() const;
23  double GetMinAngle() const;
24 
25  void InitSendable(frc::SendableBuilder& builder) override;
26 
27  private:
28  double GetServoAngleRange() const;
29 
30  static constexpr double kMaxServoAngle = 300.0;
31  static constexpr double kMinServoAngle = 0.0;
32 
33  static constexpr double kDefaultMaxServoPWM = 2.5;
34  static constexpr double kDefaultMinServoPWM = 0.5;
35 };
studica::Servo
Definition: Servo.h:10