|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
JAVA Printing
Hello,
Is there any way to print something from the code and have it display to the user? Tired System.out.print(); and didn't see anything come up. Thanks in advance ![]() |
|
#2
|
||||
|
||||
|
Re: JAVA Printing
public void output(String text){
System.out.println(text); } |
|
#3
|
||||
|
||||
|
Re: JAVA Printing
That prints to the Net Beans console, useful for debugging, not so useful in competition though. Does any one know how to print to the Drive Station console?
|
|
#4
|
||||
|
||||
|
Re: JAVA Printing
printing to the driver station you only have 7 lines or so, and you have to replace previous lines. So utilizing it for debugging is a little difficult.
it doesnt work like a typical printf where you can keep going. |
|
#5
|
|||
|
|||
|
Re: JAVA Printing
To output text to the Driver Station, you must create a DriverStationLCD object. Once it has been initialized, lines can be outputted using:
Code:
[DriverStationLCD object name].println(DriverStationLCD.Line.[line],
[Priority], [message]);
|
|
#6
|
||||
|
||||
|
Re: JAVA Printing
Ah, yes that worked. For some reason I got a null pointer exception when I tried that before. It worked now though. Thanks!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|