Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Displaying Data in the Driver Station Output (http://www.chiefdelphi.com/forums/showthread.php?t=125590)

toastergod 01-02-2014 09:55

Displaying Data in the Driver Station Output
 
I have written a program that is supposed to take a value given by a potentiometer, and display it in the driver station output. I have tried using

"System.out.println();"

however this does not output to the driver station. I then attempted to use

"driverStat.println(DriverStationLCD.Line.kMai n6, startingColumn, "Potentiometer: " + POT.get());".

This however does not output anything either. Any fiddling with the potentiometer will not display anything.

Here is my full code:

TF_PrintPot.java:

Code:

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package POTcheck;

import edu.wpi.first.wpilibj.DriverStationLCD;
import edu.wpi.first.wpilibj.AnalogPotentiometer;

public class  TF_PrintPot {
    public AnalogPotentiometer POT = new AnalogPotentiometer(1,1);
   
    public DriverStationLCD driverStat = DriverStationLCD.getInstance();
    public int startingColumn = 1;
    public TF_PrintPot() {
   
}
    public void pot () {
                     
        System.out.println(POT.get());
        driverStat.println(DriverStationLCD.Line.kMain6, startingColumn, "Pot " + POT.get());
        driverStat.updateLCD();
       
    }
}

TestProject.java:

Code:

/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                            */
/* Open Source Software - may be modified and shared by FRC teams. The code  */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                              */
/*----------------------------------------------------------------------------*/

package POTcheck;


import edu.wpi.first.wpilibj.SimpleRobot;


/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the SimpleRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class TestProject extends SimpleRobot {
    /**
    * This function is called once each time the robot enters autonomous mode.
    */
    public TF_PrintPot POTrun = new TF_PrintPot();
    public void autonomous() {
       
    }

    /**
    * This function is called once each time the robot enters operator control.
    */
    public void operatorControl() {
       
        while(true) {
            POTrun.pot();
        }
    }
   
    /**
    * This function is called once each time the robot enters test mode.
    */
    public void test() {
   
    }
}

I have attempted to search in and outside of Chief Delphi and I have not found anything. Thank you for your assistance.

CreativeName55 01-02-2014 13:04

Re: Displaying Data in the Driver Station Output
 
Just a question, are you using smart dashboard or something of that nature?

Domenic Rodriguez 01-02-2014 16:08

Re: Displaying Data in the Driver Station Output
 
Looking at the Javadoc for DriverStationLCD.Line, it says that DriverStationLCD.Line.kMain6 has been deprecated. Try using DriverStationLCD.Line.kUser1 instead.

toastergod 01-02-2014 21:32

Re: Displaying Data in the Driver Station Output
 
Quote:

Originally Posted by CreativeName55 (Post 1335785)
Just a question, are you using smart dashboard or something of that nature?

I am not using smart dashboard as far as I've been informed by my team leader.

Joe Ross 03-02-2014 12:26

Re: Displaying Data in the Driver Station Output
 
I don't see anything obviously wrong with your code, with the exception that there is no delay in your while loop in operatorControl. Are you enabling the robot on the driver station? Are you looking for the messages on the User Messages display on the operations tab of the driver station?


All times are GMT -5. The time now is 11:00.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi