[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:
sciencewhiz
2023-07-09 21:28:50 -07:00
committed by GitHub
parent fd5699b240
commit f8e74e2f7c
5 changed files with 283 additions and 22 deletions

View File

@@ -253,5 +253,7 @@ public class PWM implements Sendable, AutoCloseable {
builder.setSafeState(this::setDisabled);
builder.addDoubleProperty(
"Value", this::getPulseTimeMicroseconds, value -> setPulseTimeMicroseconds((int) value));
builder.addDoubleProperty("Speed", this::getSpeed, this::setSpeed);
builder.addDoubleProperty("Position", this::getPosition, this::setPosition);
}
}