mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal] Unify PWM simulation Speed, Position, and Raw (#5277)
Setting one will set the others, like it does in real hardware. Add tests for boundary conditions and conversions. Update PWM sendable implementation to include all forms. Fixes #5264 Fixes #3606
This commit is contained in:
@@ -180,4 +180,10 @@ void PWM::InitSendable(wpi::SendableBuilder& builder) {
|
||||
builder.AddDoubleProperty(
|
||||
"Value", [=, this] { return GetPulseTime().value(); },
|
||||
[=, this](double value) { SetPulseTime(units::millisecond_t{value}); });
|
||||
builder.AddDoubleProperty(
|
||||
"Speed", [=, this] { return GetSpeed(); },
|
||||
[=, this](double value) { SetSpeed(value); });
|
||||
builder.AddDoubleProperty(
|
||||
"Position", [=, this] { return GetPosition(); },
|
||||
[=, this](double value) { SetPosition(value); });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user