mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[wpilib] Set AnalogPotentiometer dashboard type (#2825)
There's not a specific dashboard type for potentiometers, so use analog input.
This commit is contained in:
@@ -44,6 +44,7 @@ double AnalogPotentiometer::Get() const {
|
||||
double AnalogPotentiometer::PIDGet() { return Get(); }
|
||||
|
||||
void AnalogPotentiometer::InitSendable(SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("Analog Input");
|
||||
builder.AddDoubleProperty(
|
||||
"Value", [=]() { return Get(); }, nullptr);
|
||||
}
|
||||
|
||||
@@ -159,6 +159,7 @@ public class AnalogPotentiometer implements Potentiometer, Sendable, AutoCloseab
|
||||
@Override
|
||||
public void initSendable(SendableBuilder builder) {
|
||||
if (m_analogInput != null) {
|
||||
builder.setSmartDashboardType("Analog Input");
|
||||
builder.addDoubleProperty("Value", this::get, null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user