|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
Re: Console output
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. |
|
#3
|
|||
|
|||
|
Re: Console output
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 Last edited by jrws : 21-01-2010 at 02:20. Reason: To avoid double posting |
|
#4
|
|||
|
|||
|
Re: Console output
(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: Quote:
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. |
|
#5
|
|||
|
|||
|
Re: Console output
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sending info to a console | a kenny03 | Java | 18 | 03-02-2010 15:08 |
| Problem receiving console output from cRIO | Arborama | Programming | 7 | 15-02-2009 03:30 |
| Operator Console | jph399 | General Forum | 3 | 29-01-2009 16:59 |
| Console says: errno=71 | wt200999 | FRC Control System | 0 | 09-01-2009 17:56 |
| PC versus Console | Denman | Chit-Chat | 40 | 22-05-2005 18:01 |