View Single Post
  #11   Spotlight this post!  
Unread 12-11-2012, 22:09
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Java Code Deploying Help

In this :
Code:
public void teleopPeriodic() {
        if (control.getRawButton(1)){ // if button 1 pressed drive at full speed
            driveSys.tankDrive(control, 2, control, 5);
        }else {                       // else drive at half speed 
            driveSys.tankDrive(control, 2, control, 5);
            driveSys.setMaxOutput(0.5);
        }
    }
Make sure you setMaxOutput() back to 1 when the button is pressed. So,
Code:
public void teleopPeriodic() {
        if (control.getRawButton(1)){ // if button 1 pressed drive at full speed
            driveSys.tankDrive(control, 2, control, 5);
            driveSys.setMaxOutput(1);
        }else {                       // else drive at half speed 
            driveSys.tankDrive(control, 2, control, 5);
            driveSys.setMaxOutput(0.5);
        }
    }
__________________
All opinions are my own.
Reply With Quote