Thread: Inverting Axis
View Single Post
  #5   Spotlight this post!  
Unread 02-02-2015, 11:46
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,077
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Inverting Axis

Quote:
Originally Posted by notmattlythgoe View Post

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.
}
Is this just a matter of aesthetics, or does it actually generate more efficient code?


Reply With Quote