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?

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).

I will post the lines needed for printing to the Dashboard LCD when my school lets out today. (If I remember anyway…)

Some uncompiled 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:


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.

Windriver => File => New => Example => VxWorks Downloadable Kernel Module Sample Project => Next => FRC Driver Station LCD Text => Finish

gives you a working example.