SmartDashboard Robot Preferences Issues

#1

I’m having trouble with using the SmartDashboard’s robot preferences for changing constants without redeploying code. Whenever I run code I was expecting for the “MotorPower” robot preference to show up in the table on my SmartDashboard but it only displays “.type, robotpreferences, String”. Not sure what I should do.

0 Likes

#2

I suspect this won’t be helpful, but… SmartDashboard was deprecated last year and I suspect they’re going to remove it in a season or two. You may want to switch to Shuffleboard.

1 Like

#3

That could be. Didn’t know it had been deprecated. Thanks

0 Likes

#4

Unlike with putNumber you have to add the variables you are getting yourself. Click add then type in the variable name and choose the type. Then you can modify the value from where you are now.
It may be deprecated but it still functions at least for me.

0 Likes

#6

Quick question: Where do you save/load the preferences? This is needed for actually changing the values, right?

0 Likes

#7

Do you mean in the code or on the dashboard? The dashboard saves them automatically although it has a tendency to be inconsistent. I strongly recommend hard coding them after tuning or writing them down somewhere.
If you haven’t already look at this tutorial by first.
https://wpilib.screenstepslive.com/s/currentCS/m/smartdashboard/l/255423-setting-robot-preferences-from-smartdashboard

0 Likes

#9

On the dashboard. So after I change a value on the dashboard it should change automatically, I don’t have to save or load it? Right now I’m just trying to alter the motor speed and it doesn’t respond to my changes.

0 Likes

#10

Yeah it should change it automatically once you type in the number then just click out of the box. There’s no save, load or send button you have to press. Most likely you have some sort of issue in your code.

0 Likes

#11

Sounds good. Thank you

0 Likes