View Single Post
  #2   Spotlight this post!  
Unread 23-03-2010, 08:41
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Inverting controls in Java

Code:
RobotDrive myDrive = new RobotDrive(1,2,3,4);

if( invertMyDrive == true )
{
 myDrive.setInvertedMotor(kFrontLeft, true);
 myDrive.setInvertedMotor(kFrontRight, true);
 myDrive.setInvertedMotor(kRearLeft, true);
 myDrive.setInvertedMotor(kRearRight, true);
}

myDrive.tankDrive(leftStick, rightStick);
The above snippet will reverse the forward/backward direction of your bot if the "invertMyDrive" variable (a boolean) is set.

It sounds like if your axes got switched, you only inverted half of the drive.
Reply With Quote