View Single Post
  #8   Spotlight this post!  
Unread 12-02-2013, 13:01
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Help programming joystick buttons

Code:
      public void operatorControl() {
      chassis.setSafetyEnabled(true);  {
            chassis.tankDrive(leftStick, rightStick);
            Timer.delay(0.01);

     }
     }
A quick aside:
Because you are using SimpleRobot you need to put the teleop code in a loop, e.g.:
Code:
      public void operatorControl() {
         chassis.setSafetyEnabled(true);
         while (isOperatorControl && isEnabled() ){
            chassis.tankDrive(leftStick, rightStick);
            Timer.delay(0.01);
         }
      }
The above suggestions for button use are all good, so if they aren't working this might be part of the problem. If you just typed from memory and forgot, ignore this. You also had a superfluous set of braces after you SafetyEnabled, did you accidentally delete something?

Just noticed you have a 30s delay in autonomous. Autonomous mode is only 15s. Unless something changed this year operatorControl() won't be called until autonomous() exits. So you'll be waiting 15s after teleop starts to get control of the 'bot.

Last edited by omalleyj : 12-02-2013 at 13:07. Reason: noticed autonomous delay
Reply With Quote