Go to Post I mean, there is a 40 second period where your alliance has to play defense, so you might as well play it well. - Jeff Rodriguez [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 08:40.

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