Log in

View Full Version : How to print values on smartdashboard


cad321
15-01-2015, 18:07
Hello,

My team is attempting to program a potentiometer and get a value from it and have it displayed on the smartDashboard in the 2015 driver station. Starting with a potentiometer would be great, but if some help could be given in printing values for anything that would be even better.

gadet
15-01-2015, 18:48
I assume that you are putting a number from the potentiometer onto the dashboard. The code below is an example for when the potentiometer is connected to port 0


AnalogPotentiometer pot = new AnalogPotentiometer(0, 360, 30);
SmartDashboard.putNumber("Potentiometer Value", pot.get());


For more reference:

Potentiometers: http://wpilib.screenstepslive.com/s/4485/m/13810/l/241877-potentiometers-measuring-joint-angle-or-linear-motion
SmartDashboard: http://wpilib.screenstepslive.com/s/4485/m/26401/l/255412-displaying-expressions-from-within-the-robot-program

cad321
17-01-2015, 10:22
So we have tried that but we still aren't printing to the smart dashboard. This code worked last year while using netbeans. We've also turned off IPV6.

cad321
17-01-2015, 10:36
Never mind. We found that our IP was set to 255.0.0.0 when it needed to be 255.255.255.0. Thank you for the help.