Go to Post FIRST isn't about the money. It is about the experience. - dubious elise [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-29-2016, 07:21 PM
simon1636 simon1636 is offline
Registered User
FRC #4501
 
Join Date: Dec 2015
Location: California
Posts: 9
simon1636 is an unknown quantity at this point
Throttle Trouble

Hi! I am trying to get our shooter to work with two talons by moving the throttle on the Attack 3 joystick upwards. My code looks right, but is not doing anything. Can any of you guys see anything? Any help would be greatly appreciated! Thanks!

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 edu.wpi.first.wpilibj.templates;



import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
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 RobotTemplate extends SimpleRobot {
    /**
     * This function is called once each time the robot enters autonomous mode.
     */
    
    Jaguar lTalon,rTalon;
    Joystick throttle;
    RobotDrive driveTrain;
    
    
    
    
    public void autonomous() {
        
    }

    /**
     * This function is called once each time the robot enters operator control.
     */
    
    public void robotInit(){
        lTalon=new Jaguar(1);
        rTalon=new Jaguar(2);
        
        throttle=new Joystick(0);
        
        driveTrain=new RobotDrive(lTalon,rTalon); 
    }
    public void operatorControl() {
    
        while(isOperatorControl() &&isEnabled()){
           
            driveTrain.arcadeDrive(throttle.getAxis(Joystick.AxisType.kZ), 0);
            
                 
            
        
     
            
            
        }
                
           
        }

    }
    
    /**
     * This function is called once each time the robot enters test mode.
     */
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:27 AM.

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