View Single Post
  #3   Spotlight this post!  
Unread 04-02-2012, 12:17
ssirovica's Avatar
ssirovica ssirovica is offline
Programming Captain
AKA: Sasha Sirovica
FRC #1458 (Red Ties)
Team Role: Programmer
 
Join Date: Sep 2011
Rookie Year: 2010
Location: Alamo
Posts: 26
ssirovica is an unknown quantity at this point
Re: how to print debugging statements to Netbeans

You can also use this code to print to the dashboard on the Classmate or another PC. Here is an example:
PHP Code:
public void printToClassmate(){

       
DriverStationLCD driverStation DriverStationLCD.getInstance();
       
driverStation.println(DriverStationLCD.Line.kUser21"Left Speed: " Double.toString(leftEncoder.getRate()));
       
driverStation.println(DriverStationLCD.Line.kUser31"Right Encoder: " Double.toString(rightEncoder.getDistance()));
       
driverStation.println(DriverStationLCD.Line.kUser41"Axis output: " Double.toString(leftStick.getRawAxis(4)));
       
//driverStation.println(DriverStationLCD.Line.kUser5, 1, "URF: " + Double.toString(ultra.getRangeInches()));
       //driverStation.println(DriverStationLCD.Line.kUser4, 1, "Gyro angle: " + Double.toString(gyro.getAngle()));

       
driverStation.updateLCD();
    } 
Just make sure to change kUser after every line because that is the line number it prints on, and call this method in your main While loop.
__________________
Computers run on smoke. When you let the smoke out the computer stops working.
Reply With Quote