Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Problem sending messages to Driver Station LCD (http://www.chiefdelphi.com/forums/showthread.php?t=89120)

wdell 14-01-2011 14:24

Problem sending messages to Driver Station LCD
 
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

Code:

DriverStationLCD.getInstance().println(DriverStationLCD.Line.kMain6, 1, msg);
it throws an exception. What am I doing wrong?

Thanks!

ArchVince 14-01-2011 18:05

Re: Problem sending messages to Driver Station LCD
 
Ah, the LCD. I'm pretty sure that you just forgot an import.
Did you import BOTH of these?
PHP Code:

import edu.wpi.first.wpilibj.DriverStationLCD;
import edu.wpi.first.wpilibj.DriverStationLCD.Line

If so...In my code I always use
PHP Code:

Line.kUser6 

instead of
PHP Code:

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

Re: Problem sending messages to Driver Station LCD
 
Quote:

Originally Posted by wdell (Post 1000021)
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

Code:

DriverStationLCD.getInstance().println(DriverStationLCD.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

Re: Problem sending messages to Driver Station LCD
 
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!


All times are GMT -5. The time now is 10:26.

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