mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilib] PWMSpeedController: Use PWM by composition (#3248)
This cleans up the user experience by removing lower-level functions from the interface. Also remove MotorSafety from "raw" PWM.
This commit is contained in:
@@ -6,16 +6,13 @@
|
||||
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
|
||||
#include "frc/smartdashboard/SendableRegistry.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
Talon::Talon(int channel) : PWMSpeedController(channel) {
|
||||
SetBounds(2.037, 1.539, 1.513, 1.487, 0.989);
|
||||
SetPeriodMultiplier(kPeriodMultiplier_1X);
|
||||
SetSpeed(0.0);
|
||||
SetZeroLatch();
|
||||
Talon::Talon(int channel) : PWMSpeedController("Talon", channel) {
|
||||
m_pwm.SetBounds(2.037, 1.539, 1.513, 1.487, 0.989);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_1X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
|
||||
HAL_Report(HALUsageReporting::kResourceType_Talon, GetChannel() + 1);
|
||||
SendableRegistry::GetInstance().SetName(this, "Talon", GetChannel());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user