Thread: Inverting Axis
View Single Post
  #4   Spotlight this post!  
Unread 02-02-2015, 11:41
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,717
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Inverting Axis

Quote:
Originally Posted by Oromus View Post
I'd suggest multiplying the axis you want to invert by -1. Example code:

Code:
if (reversing) { //Put whatever code you use to detect if you're reversing here
     myMotor.set(joystick.getYAxis() * -1); //Set a motor to the inverse of the Y axis.
}
You can also just place a - in front of it.

Code:
if (reversing) { //Put whatever code you use to detect if you're reversing here
     myMotor.set(-joystick.getYAxis()); //Set a motor to the inverse of the Y axis.
}
Reply With Quote