Log in

View Full Version : Send User Messages (Driver Station)


gixxy
14-02-2012, 10:43
what class/code is used in sending messages to the Driver Station's "User Messages" box?

notmattlythgoe
14-02-2012, 10:45
http://www.wbrobotics.com/javadoc/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.html

One of the put() methods depending on what data you want to send.

Joe Ross
14-02-2012, 11:43
what class/code is used in sending messages to the Driver Station's "User Messages" box?

The DriverStationLCD class.

http://www.wbrobotics.com/javadoc/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.html

One of the put() methods depending on what data you want to send.

The SmartDashboard class is for sending data to the SmartDashboard, not to the UserMessages area of the driver station.

notmattlythgoe
14-02-2012, 11:45
The DriverStationLCD class.



The SmartDashboard class is for sending data to the SmartDashboard, not to the UserMessages area of the driver station.

You are right, my mistake.

Intel i7
14-02-2012, 12:29
I created a method that helps us display stuff easier


public static void disp(int line, String msg)
{
DriverStationLCD.Line l;
switch (line)
{
case 1:
l = DriverStationLCD.Line.kUser2;
break;
case 2:
l = DriverStationLCD.Line.kUser3;
break;
case 3:
l = DriverStationLCD.Line.kUser4;
break;
case 4:
l = DriverStationLCD.Line.kUser5;
break;
case 5:
l = DriverStationLCD.Line.kUser6;
break;
case 6:
l = DriverStationLCD.Line.kMain6;
break;
default:
l = DriverStationLCD.Line.kUser2;
break;
}

DriverStationLCD.getInstance().println(l, 1, msg);
DriverStationLCD.getInstance().updateLCD();
}

Herbblood
14-02-2012, 20:14
println(DriverStationLCD.Line, int, StringBuffer) - Method in class edu.wpi.first.wpilibj.DriverStationLCD
Print formatted text to the Driver Station LCD text buffer.
and don't forget LCD update.