Programming Support

This area contains resources related to programming. In some cases topics are programming language dependant.

This page is to support both our team, as well as others, with programming guides and resources. A lot of knowledge is available across the web and we hope to collect what we find useful here. If you have a reference we should add, please feel free to contact us!

dashboardIn 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:
http://www.wbrobotics.com/javadoc/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.html

In your java code you need to import the SmartDashboard class:
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

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.

 

Helpful links:

WPI Documentation

WPI SmartDashboard Video

 
 
 
 

Accessibility

Valid XHTML 1.0 Transitional  

See your web site through colorblind eyes with the colorblind web page filter.