Go to Post Things go wrong; it happens to the best of us. You learn from it and move on. - Waynep [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-01-2010, 23:29
jrws jrws is offline
Proff. Sinclair
AKA: James
FRC #3132 (Thunder Down Under)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Australia
Posts: 6
jrws is on a distinguished road
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
Reply With Quote
  #2   Spotlight this post!  
Unread 21-01-2010, 01:43
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 159
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 21-01-2010, 02:02
jrws jrws is offline
Proff. Sinclair
AKA: James
FRC #3132 (Thunder Down Under)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Australia
Posts: 6
jrws is on a distinguished road
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
Reply With Quote
  #4   Spotlight this post!  
Unread 21-01-2010, 03:14
Abrakadabra Abrakadabra is offline
Here We Go !!!
AKA: Scott Kukshtel, Mr. K
FRC #3467 (The Windham Windup!)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Windham, New Hampshire
Posts: 159
Abrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant futureAbrakadabra has a brilliant future
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 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.
Reply With Quote
  #5   Spotlight this post!  
Unread 21-01-2010, 04:33
jrws jrws is offline
Proff. Sinclair
AKA: James
FRC #3132 (Thunder Down Under)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Australia
Posts: 6
jrws is on a distinguished road
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
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 12:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi