View Single Post
  #5   Spotlight this post!  
Unread 02-03-2014, 17:36
James Lightfoot James Lightfoot is offline
Programming & Electrical Mentor
FRC #3737 (Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Wayne County, NC
Posts: 21
James Lightfoot is just really niceJames Lightfoot is just really niceJames Lightfoot is just really niceJames Lightfoot is just really niceJames Lightfoot is just really nice
Re: sending variables from driver station to robot?

Quote:
Originally Posted by Joe Ross View Post
In general, you can call SmartDashboard.putNumber in an init method (so that it gets loaded on the SmartDashboard), and then call SmartDashboard.getNumber to read the current value on the Smart Dashboard.

If you are using the PIDController class, there is already a PID widget on Smart Dashobard that lets you change P, I, and D, and the setpoint. You can add the PIDController as an actuator with LiveWindow, and test whatever you want.

See:
http://wpilib.screenstepslive.com/s/...ewindow-values
http://wpilib.screenstepslive.com/s/...smartdashboard
Please pardon me if my question seams redundant.

We are using Java for our cRIO and the Java version of the Smart Dashboard. How can we have an operator/driver enter number values
in the Smart Dashboard (or other software interface) and have them "pushed" to the cRIO as values to use in certain parts of the code?

For example, we have an ultrasonic sensor that feeds the cRIO an analog signal based on how far the sensor is from the wall (front mount). We know that we need our robot to be 7'/84" from the wall to shoot for and make the high goal. In autonomous, I would like to have the ability for the driver to enter that value in the driver station and have it passed to that filed in the autonomous code to allow on site tweaking w/o having to do multiple downloads to the cRIO.

Thanks.
Reply With Quote