mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
[wpilib] AnalogPotentiometer: provide scaled value to Dashboard (#2824)
Previously this sent just the raw analog value; the scaled value is likely what users expect. Co-authored-by: Corey Applegate <coreya@centralmcgowan.com>
This commit is contained in:
@@ -44,5 +44,6 @@ double AnalogPotentiometer::Get() const {
|
||||
double AnalogPotentiometer::PIDGet() { return Get(); }
|
||||
|
||||
void AnalogPotentiometer::InitSendable(SendableBuilder& builder) {
|
||||
m_analog_input->InitSendable(builder);
|
||||
builder.AddDoubleProperty(
|
||||
"Value", [=]() { return Get(); }, nullptr);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public class AnalogPotentiometer implements Potentiometer, Sendable, AutoCloseab
|
||||
@Override
|
||||
public void initSendable(SendableBuilder builder) {
|
||||
if (m_analogInput != null) {
|
||||
m_analogInput.initSendable(builder);
|
||||
builder.addDoubleProperty("Value", this::get, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user