mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Add getVoltage to PWMMotorController (#6044)
This commit is contained in:
@@ -37,6 +37,10 @@ double PWMMotorController::Get() const {
|
||||
return m_pwm.GetSpeed() * (m_isInverted ? -1.0 : 1.0);
|
||||
}
|
||||
|
||||
units::volt_t PWMMotorController::GetVoltage() const {
|
||||
return Get() * RobotController::GetBatteryVoltage();
|
||||
}
|
||||
|
||||
void PWMMotorController::SetInverted(bool isInverted) {
|
||||
m_isInverted = isInverted;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user