View Full Version : SmartDashboard Problem
I am new to setting up a custom dashboard - right now, when I use putNumber(), where is the value I set going? I am able to retrieve it using getNumber(), but I can't get the value to display on the dashboard.
AustinShalit
19-11-2016, 07:38
Hi there! Please make sure you followed all of the instructions here:
https://wpilib.screenstepslive.com/s/4485/m/26401/l/255407-getting-started-with-the-smartdashboard?id=255407-getting-started-with-the-smartdashboard
You may also want to try to add a Connection Indicator (View -> Add... -> Connection Indicator).
euhlmann
19-11-2016, 11:28
When you do this in robot code
SmartDashboard.putNumber("something", 1);
it goes on the SmartDashboard table.
So on a custom dashboard you might do (in Java)
NetworkTable sd = NetworkTable.getTable("SmartDashboard");
sd.getNumber("something"); // 1
Thanks! So do I have to be connected to the robot to be able to see the dashboard? Am I able to see it disconnected, just with no values in the spaces where values are supposed to be?
euhlmann
20-11-2016, 12:44
Thanks! So do I have to be connected to the robot to be able to see the dashboard? Am I able to see it disconnected, just with no values in the spaces where values are supposed to be?
You have to be connected. If you are not connected, this (deprecated) throws an exception
NetworkTable.getTable("SmartDashboard").getNumber("something")
and this (the recommended way)
NetworkTable.getTable("SmartDashboard").getNumber("something", defaultValue)
returns defaultValue
However if you connect and then disconnect, the values returned will be the last known values.
TylerHarmon
23-11-2016, 02:42
I am new to setting up a custom dashboard - right now, when I use putNumber(), where is the value I set going? I am able to retrieve it using getNumber(), but I can't get the value to display on the dashboard.
Yep, the values go into SmartDashboard.jar. You don't need to be connected to the robot to run that, you can run it while disconnected, and the values will be blank. You can also enable the edit mode and configure the layout of the dashboard, add dials/bars/graphs, etc. In addition, check out the SmartDashboard SFX (https://wpilib.screenstepslive.com/s/4485/m/26401/l/255406-the-new-smartdashboard-sfx), which allows for more visual control.
Last year I used this to display, on a dial and a bar, the amount of pressure that our pneumatic system had left so that our drivers could tell if they had enough pressure to fire or not. It's a great tool that's easy to use :)
Good luck!
Yep, the values go into SmartDashboard.jar. You don't need to be connected to the robot to run that, you can run it while disconnected, and the values will be blank. You can also enable the edit mode and configure the layout of the dashboard, add dials/bars/graphs, etc. In addition, check out the SmartDashboard SFX (https://wpilib.screenstepslive.com/s/4485/m/26401/l/255406-the-new-smartdashboard-sfx), which allows for more visual control.
Last year I used this to display, on a dial and a bar, the amount of pressure that our pneumatic system had left so that our drivers could tell if they had enough pressure to fire or not. It's a great tool that's easy to use :)
Good luck!
Thanks for the info. I don't see any blank values at all when I check SmartDashboard.jar - when I try to add preferences, the preferences box doesn't update, and when I try to use a method like putNumber(), nothing new shows up. Do you have any code examples so I can see what I'm doing wrong?
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.