Input Monitoring

I’m pretty new to robot programming so my fundamentals may be a bit off here (I’m good at Java itself, not robot Java). Bear with me here guys :smiley:

So I’m using a Joystick that’s pretty easy to configure and I’ve proven that I am in fact receiving correct info from the axes and the buttons. The only thing I really want to do is print it out in the “User Messages” box in the Driver Station.

Now I’ve gotten up to actually printing info out using DriverStationLCD but the problem with it is, the info box only updates itself once and only when the robot is first enabled after I’ve compiled the code. Then that same info stays there no matter how many times I re-enable. The only way to update the info is to recompile the code and enable again (and even then only the initial input gets displayed, it’s not updated real-time like I’d want it to be).

A bit more background on the code:
I’m using the IterativeRobot template.
I’ve tried running it from both the Periodic and Continuous teleop methods, and neither work. From what I’ve read, the method is supposed to be continuously called so me being logical I put in commands to retrieve the info from the joystick and then output it. As I’m thinking now the method (running continuously and all) should be retrieving fresh info and updating the LCD quite often (definitely not never).

Anyway here’s the code for my teleopPeriodic() method:
lXAxis/lYAxis are doubles.
buttons are booleans
stick is a Joystick object
st is a DriverStation object
out is a DriverStationLCD object.

    public void teleopPeriodic() {

        lXAxis = st.getStickAxis(1, 1);
        lYAxis = st.getStickAxis(1, 2);
        button1 = stick.getRawButton(1);
        button2 = stick.getRawButton(2);
        button3 = stick.getRawButton(3);
        button4 = stick.getRawButton(4);

        String b1out = "B1: " + button1;
        String b2out = "B2: " + button2;
        String b3out = "B3: " + button3;
        String b4out = "B4: " + button4;
        String lyaxisout = "LYAxis: " + lYAxis;
        String lxaxisout = "LXAxis: " + lXAxis;

        out.println(DriverStationLCD.Line.kMain6, 1, b1out);
        out.println(DriverStationLCD.Line.kUser2, 1, b2out);
        out.println(DriverStationLCD.Line.kUser3, 1, b3out);
        out.println(DriverStationLCD.Line.kUser4, 1, b4out);
        out.println(DriverStationLCD.Line.kUser5, 1, lyaxisout);
        out.println(DriverStationLCD.Line.kUser6, 1, lxaxisout);

So I discovered the SmartDashboard class. I am not anywhere near the robot to test any of this out but I made the following code. Would it help at doing this?

        SmartDashboard.log(String.valueOf(lXAxis), "L-X: ");
        SmartDashboard.log(String.valueOf(lYAxis), "L-Y: ");
        SmartDashboard.log(String.valueOf(button1), "B1: ");
        SmartDashboard.log(String.valueOf(button2), "B2: ");
        SmartDashboard.log(String.valueOf(button3), "B3: ");
        SmartDashboard.log(String.valueOf(button4), "B4: ");