View Single Post
  #4   Spotlight this post!  
Unread 21-02-2015, 07:02
Brrch Brrch is offline
Registered User
AKA: Alon
FRC #2212 (Spikes)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2013
Location: Israel
Posts: 4
Brrch is an unknown quantity at this point
Re: Custom SmartDashboard Widget Repository

Quote:
Originally Posted by lopsided98 View Post
Here's the other useful widget I wrote; it displays commands that have parameters, which you can set from the SmartDashboard. It requires code on the robot, which I have only written in Java, but it can be ported to C++ fairly easily.

This widget is useful for debugging commands, because you can put them on the SD and then play with parameters and make sure they react correctly.

The ParameterCommand.jar file contains the widget, while the src folder contains the source for both the widget and the robot code. The robot code includes an example (RotateToCommand.java) from our code which demonstrates the usage of the ParameterCommand.

When you want to use put the command on the SD, you simply have to call:
Code:
SmartDashboard.putData(yourParameterCommand);
If you use RobotBuilder, the "Button on SmartDashboard" checkbox also works as long as your command has a default constructor.
When I tried to copy the classes to a Robot Project it said that the import edu.wpi.first.smartdashboard could not be resolved. Which library should I use?