Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Print into User Messages on DS (http://www.chiefdelphi.com/forums/showthread.php?t=104068)

DavisC 01-03-2012 18:50

Print into User Messages on DS
 
So this question is pretty simple, how do I print a message into the User Messages box on the Driver Station?
Also is there a different #include needed?

RufflesRidge 01-03-2012 19:12

Re: Print into User Messages on DS
 
Check out the DriverStationLCD class. You should not need any additional includes, it should be covered by the wpilib.h include (I'm pretty sure on that, but it's been a while since I've used that particular feature).

normpear2 07-03-2012 09:18

Re: Print into User Messages on DS
 
I will post the lines needed for printing to the Dashboard LCD when my school lets out today. (If I remember anyway...)

WizenedEE 08-03-2012 22:28

Re: Print into User Messages on DS
 
Some uncompiled code:
Code:

DriverStationLCD ds = DriverStationLCD::GetInstance();
int val = 42;
ds.Printf(DriverStationLCD::kUser_Line1, "My Value is: %d", val);
ds.UpdateLCD(); // Call at the end of teleop periodic if you're doing multiple printfs.


mikets 09-03-2012 01:52

Re: Print into User Messages on DS
 
Quote:

Originally Posted by WizenedEE (Post 1141224)
Some uncompiled code:
Code:

DriverStationLCD ds = DriverStationLCD::GetInstance();
int val = 42;
ds.Printf(DriverStationLCD::kUser_Line1, "My Value is: %d", val);
ds.UpdateLCD(); // Call at the end of teleop periodic if you're doing multiple printfs.


Minor correction. GetInstance gives you a pointer. So it should be:

Code:

DriverStationLCD *ds = DriverStationLCD::GetInstance();
int val = 42;
ds->PrintfLine(DriverStationLCD::kUser_Line1, "My Value is: %d", val);
ds->UpdateLCD(); // Call at the end of teleop periodic if you're doing multiple printfs.


garyk 10-03-2012 19:09

Re: Print into User Messages on DS
 
Windriver => File => New => Example => VxWorks Downloadable Kernel Module Sample Project => Next => FRC Driver Station LCD Text => Finish

gives you a working example.


All times are GMT -5. The time now is 17:41.

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