View Single Post
  #1   Spotlight this post!  
Unread 30-01-2016, 17:59
simon1636 simon1636 is offline
Registered User
FRC #4501
 
Join Date: Dec 2015
Location: California
Posts: 9
simon1636 is an unknown quantity at this point
Re: Throttle Trouble

It still does not seem to be working. Do you see anything else weird? I did all that you said.

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;
    
    
    
    
    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);
        
    }
    public void operatorControl() {
    
        while(isOperatorControl() &&isEnabled()){
           lTalon.set(throttle.getZ());
           rTalon.set(-throttle.getZ());
            
                 
            
        
     
            
            
        }
                
           
        }

    }
    
    /**
     * This function is called once each time the robot enters test mode.
     */
Reply With Quote