Log in

View Full Version : Problem sending messages to Driver Station LCD


wdell
14-01-2011, 14:24
Every time I try to send a message to the LCD I get a NullPointerException, no matter what I try or who's code I copy. If it hits the line


DriverStationLCD.getInstance().println(DriverStati onLCD.Line.kMain6, 1, msg);


it throws an exception. What am I doing wrong?

Thanks!

ArchVince
14-01-2011, 18:05
Ah, the LCD. I'm pretty sure that you just forgot an import.
Did you import BOTH of these?
import edu.wpi.first.wpilibj.DriverStationLCD;
import edu.wpi.first.wpilibj.DriverStationLCD.Line;

If so...In my code I always use
Line.kUser6
instead of
DriverStationLCD.Line.kUser6
but that probably wouldn't make a difference.
Also, make sure you update the LCD. You won't see any output otherwise.

rrossbach
14-01-2011, 19:16
Every time I try to send a message to the LCD I get a NullPointerException, no matter what I try or who's code I copy. If it hits the line


DriverStationLCD.getInstance().println(DriverStati onLCD.Line.kMain6, 1, msg);


it throws an exception. What am I doing wrong?

Thanks!

Please post the exception you're getting (including the stack trace) and we can try to help

- Ron
Team #2607 controls mentor

wdell
15-01-2011, 11:46
ArchVince's suggestion seems to have worked. Weird, since I'm pretty sure I tried that once. Must have had the syntax wrong.

Thanks for all the help!