Console output

Hey all,

I am relatively new to C++ but I know enough about the basics to get by, my question is, is there a way to print output to the screen in the drivers station? I have had a look at some documentation and haven’t been able to find anything as of yet, so any help would be appreciated.

BTW could someone suggest how we can test joysticks and the like, what I mean by this is that if the joy stick is moved fully forward, on screen (or on the console) it outputs 1 (meaning fully forward).

Thanks,

James
Team 3132

Check out the DriverStationLCD class in WPILib. It’s named for the 6 line LCD on last year’s DS, but now writes to the 6 line “User Messages” space on the “Operation” tab of the 2010 DS UI. (Not sure why it’s not in the documents - probably because it was released mid-season last year, and was only made an “official” part of WPILib this year.)

You can display any data you like using standard printf()-style formatting (just pay attention to line lengths - 21 characters is not very much).

Also, note (and you will soon find out) that pushing the joystick forward returns -1, and pulling it back returns +1. It’s usually not a critical issue because all of the WPILib routines account for it, but if you are directly reading the stick and driving a motor using the return value, you will want to account for it, because it is is a little non-intuitive. Makes perfect sense when flying a plane, but it’s backwards for driving!

HTH.

Thank you very much for your help. I am very grateful I will have a look at it. Thanks again.

EDIT:
Thanks again. However, we are having trouble doing anything with it. I have included it in our main program but because it does not have a type of return it is having trouble compiling. Do you know if it is included in the actual windriver WPIlib because it appears as if it encrypted. I just tried adding the header and cpp file into the folder, however, I am unsure what to do now. So any help is appreciated.
James
3132

(I actually have not played with it this year, so this is really all theoretical as far as I am concerned, but anyhow…)

Here is the description of the class from last year:

The C++ API consists of a class called DriverStationLCD. It is a singleton object that can be accessed from anywhere in a team’s project. Call DriverStationLCD::GetInstance() to get a pointer to the singleton. With the pointer to the DriverStationLCD, you can call the 2 primary entry points. The Printf() method works just like you expect printf to work. Before the format string, the line and starting column to print to must be specified. Call UpdateLCD() to send the locally buffered text to the driver station.
I’m not sure what you mean by a “problem compiling”? Perhaps you could post your error output?

The class is definitely in this year’s WPILib library (or at least in the source code distribution that was provided on FIRSTForge), so you should not need to add the code or header file to your project. Just #include the header file in your code and call the routines as described above. Assuming your include and library paths are set up correctly (and they should be, if you can run other WPILib-based programs) then you should be good to go.

Thank you again for your help. My mentor was able to fix the problem. It appeared that the library binary did not contain the information about that class. So we have updated our windriver information and it is now working.

Thanks again

James
3132