In this guide we document how to create a custom dashboard interface using SmartDashboard.
Note: This guide was written for the 2012 season and has not yet been updated for the 2013 season. More up to date information on setup and installation of the 2013 version is avaialble here.
You'll need to install the dashboard software from here: http://firstforge.wpi.edu/sf/frs/do/viewSummary/projects.smartdashboard/frs
After installing you will need to configure a few things:
View > Add > Connection Indicator
File > Save As
Choose where you want your layout saved (remember where you put it)
File > Preferences
- Set your team number
- Set your Save File to the one you created above
Here's the javadoc for the class:
In your java code you need to import the SmartDashboard class:
To add elements to the dashboard you just call one of the put methods:
//Display Joystick 1, Axis 2 in a field on the dashboard // The first parameter (key) is going to be the label for the data you send // The 2nd parameter (value) is the data you want displayed SmartDashboard.putDouble("Joy1 Axis 2", joy1.getRawAxis(2));
Calling the putDouble method again with the same key will update an existing field's value
When you run the code a field will automatically be created on the dashboard. You can move it around if you select View > Editable
If the connection indicator doesn't light up when you run code on the robot, you've got something wrong on your computer side of things.
If it does light up when you connect, but fields you are trying to display from the code don't show up, then you have a problem somewhere in the Java code.