View Single Post
  #3   Spotlight this post!  
Unread 07-02-2013, 18:38
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,572
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: Help programming joystick buttons

Quote:
Originally Posted by wickzam View Post
We tried to use getRawButton in our code but every time we use it there is a problem.
What kind of problem?

Here is an example of using getRawButton to switch between tank drive and arcade drive when the trigger (button one) on the left joystick is pressed.

Code:
    public void operatorControl() {
        chassis.setSafetyEnabled(true);
        
        if (leftStick.getRawButton(1))
        {
            chassis.tankDrive(leftStick, rightStick);
            Timer.delay(0.01);
        }
        else 
        {
            chassis.arcadeDrive(leftStick);
        }
    }
Also, in your original code, your autonomous code won't run because autonomous is misspelled.
Reply With Quote