Hello fellow programmers,
I’ve run into a problem with the SmartDashboard.h class. As you may have found out, the DriverStationLCD class that many used last year to output text to the User Messages part of the Driver Station has been replaced with the SmartDashboard.h class. As far as I’m concerned there’s no way to actually output text to the equivalent section of this years driver station. Instead, the SmartDashboard class lets you output data to the basic tab of the FRC Dashboard. We as a team used to use this readout in the User Messages as a live feedback for our potentiometer and ultra sonic sensor values with the following code.
ds->PrintfLine(DriverStationLCD::kUser_Line3, “Pot: %f”, angle);
From what I’ve seen from the class documentation of SmartDashboard.h, there is no way to output a floating point value. Any argument for output seems to have to be char based. Also, we used to be able to use the updateLCD line to get live feedback of the values as they changed. How can we actually get such variables to output to the driver station? I would really appreciate any help that I can get. Thank you all in advance.
That is absolutely not true. See here: http://wpilib.screenstepslive.com/s/4485/m/26401/l/255412-displaying-expressions-from-within-the-robot-program. The example is in Java but the equivalent C++ will work From your example:
SmartDashboard::PutNumber("Pot Angle", angle);
That will show up on the SmartDashboard as a number, and you can change it to other types of displays such as a graph over time and other widgets, as seen here: http://wpilib.screenstepslive.com/s/4485/m/26401/l/255417?data-resolve-url=true&data-manual-id=26401.
Thank you so much fsilberberg! I must have grazed over that last night while looking at the SmartDashboard class, because it was sitting right there after I searched for it. One more question though. Do I have to mess with updating the value now? I know that before I had to, but what about now? Sorry these questions may be a bit…rudimentary. It’s my first year as programming lead and I don’t have as much experience as I really should. Thank you again!
If I’m understanding your question correctly, you are asking whether you’ll need to keep putting the values or whether it will update itself? If that’s the question, then yes, you need to keep updating it.