Go to Post We are all one big team, even though we are split into thousands of smaller teams. - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2014, 09:55
toastergod's Avatar
toastergod toastergod is offline
Programming Wizard
AKA: Sam Lehman
FRC #0279 (Tech Fusion)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: United States
Posts: 7
toastergod is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 01-02-2014, 13:04
CreativeName55 CreativeName55 is offline
Registered User
FRC #2729 (Storm Robotics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2011
Location: Marlton
Posts: 17
CreativeName55 is an unknown quantity at this point
Re: Displaying Data in the Driver Station Output

Just a question, are you using smart dashboard or something of that nature?
Reply With Quote
  #3   Spotlight this post!  
Unread 01-02-2014, 16:08
Domenic Rodriguez's Avatar
Domenic Rodriguez Domenic Rodriguez is offline
Registered User
FRC #0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Sep 2010
Rookie Year: 2011
Location: Grove City, PA
Posts: 213
Domenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura about
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.
__________________

LuNaTeCs - Learning Under Nurturing Adults Teaching Engineering Concepts and Skills - Small and Mighty!

FRC 316 LuNaTeCs - Student (2011-2014), Lead Programmer (2011-2014), Team Captain (2013-2014), Operator (2013), Drive Coach (2014), Mentor (2015-????)
'11 Philly Regional Finalists, '13 Chestnut Hill Finalists, '13 Lenape Champions, '13 Archimedes Division, '14 Chestnut Hill Champions, '14 Lenape Champions
FTC 7071 EngiNerds - Founding Advisor (2013-2014) | FRC 5420 Velocity - Founding Advisor (2015)
Grove City College Class of '18, Electrical/Computer Engineering (B.S.E.E)

Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2014, 21:32
toastergod's Avatar
toastergod toastergod is offline
Programming Wizard
AKA: Sam Lehman
FRC #0279 (Tech Fusion)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: United States
Posts: 7
toastergod is an unknown quantity at this point
Re: Displaying Data in the Driver Station Output

Quote:
Originally Posted by CreativeName55 View Post
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 03-02-2014, 12:26
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
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?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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