View Single Post
  #4   Spotlight this post!  
Unread 16-01-2012, 16:33
Nymph808's Avatar
Nymph808 Nymph808 is offline
Registered User
FRC #2443
 
Join Date: Jan 2011
Location: Maui
Posts: 11
Nymph808 is an unknown quantity at this point
Re: DriverStation User Message Problem

Quote:
Originally Posted by JewishDan18 View Post
I had a similar problem (not with old code though). Are you using this method of sending messages?

Code:
DriverStationLCD.getInstance().println(DriverStationLCD.Line.kUser2, 1,"your message");
Do you have this bit of code after you've sent all your messages?

Code:
DriverStationLCD.getInstance().updateLCD();
So this is the code I currently have. Have you got your DriverStation to print any user messages?

package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.AnalogChannel;
import edu.wpi.first.wpilibj.DriverStationLCD;

public class RobotTemplate extends IterativeRobot {


AnalogChannel b_sonar;
DriverStationLCD b_LCD;
static final int sonarPort = 6;
long lSonarCount;

public void robotInit() {
b_sonar = new AnalogChannel(sonarPort);
b_LCD = DriverStationLCD.getInstance();
b_LCD.updateLCD();
}


public void autonomousPeriodic() {
b_sonar.getVoltage();

}


public void disabledInit(){
b_LCD.println(DriverStationLCD.Line.kMain6, 1, "Print");
}

public void teleopPeriodic() {
//lSonarCount = b_sonar.getAccumulatorCount();
b_LCD.println(DriverStationLCD.Line.kUser4, 15, "Ultrasonic distance: " + b_sonar.getVoltage());
b_LCD.updateLCD();
}
Reply With Quote