mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Merge "Updates the C++ servo class to have the PWM values that are on the spec sheet"
This commit is contained in:
@@ -51,6 +51,9 @@ private:
|
||||
return kMaxServoAngle - kMinServoAngle;
|
||||
}
|
||||
|
||||
static constexpr float kMaxServoAngle = 170.0;
|
||||
static constexpr float kMaxServoAngle = 180.0;
|
||||
static constexpr float kMinServoAngle = 0.0;
|
||||
|
||||
static constexpr float kDefaultMaxServoPWM = 2.4;
|
||||
static constexpr float kDefaultMinServoPWM = .6;
|
||||
};
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
constexpr float Servo::kMaxServoAngle;
|
||||
constexpr float Servo::kMinServoAngle;
|
||||
|
||||
constexpr float Servo::kDefaultMaxServoPWM;
|
||||
constexpr float Servo::kDefaultMinServoPWM;
|
||||
|
||||
/**
|
||||
* Common initialization code called by all constructors.
|
||||
*
|
||||
@@ -21,7 +24,7 @@ constexpr float Servo::kMinServoAngle;
|
||||
void Servo::InitServo()
|
||||
{
|
||||
m_table = NULL;
|
||||
SetBounds(2.27, 1.513, 1.507, 1.5, .743);
|
||||
SetBounds(kDefaultMaxServoPWM, 0.0, 0.0, 0.0, kDefaultMinServoPWM);
|
||||
SetPeriodMultiplier(kPeriodMultiplier_4X);
|
||||
|
||||
LiveWindow::GetInstance()->AddActuator("Servo", GetModuleNumber(), GetChannel(), this);
|
||||
|
||||
Reference in New Issue
Block a user