Log in

View Full Version : DriverStation User Message Problem


Nymph808
14-01-2012, 21:09
So using Java, we ran a code that prints a message onto the DriverStation's User Messages during teleop, but the print doesn't show up. We tried running our old code from Logomotion onto the robot, but that didn't print anything either. Any ideas to why user messages isn't working?

JewishDan18
15-01-2012, 02:45
I had a similar problem (not with old code though). Are you using this method of sending messages?

DriverStationLCD.getInstance().println(DriverStati onLCD.Line.kUser2, 1,"your message");

Do you have this bit of code after you've sent all your messages?

DriverStationLCD.getInstance().updateLCD();

Nymph808
15-01-2012, 03:10
Ah yeah, I use those methods. They were on the old code, but they don't seem to work.

Nymph808
16-01-2012, 16:33
I had a similar problem (not with old code though). Are you using this method of sending messages?

DriverStationLCD.getInstance().println(DriverStati onLCD.Line.kUser2, 1,"your message");

Do you have this bit of code after you've sent all your messages?

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();
}

Ross3098
21-01-2012, 19:30
This has been a huge problem for me too this year. I'm using C++ and the code:

DriverStationLCD *m_LCD;

m_LCD->GetInstance();

m_LCD->Printf(DriverStationLCD::kUser_Line1, 1, "Message");

m_LCD->UpdateLCD();



Has no effect. I redeployed our 2011 code to it for the sake of User Message printing but all of the old commands gave no effect as well.:(