View Single Post
  #3   Spotlight this post!  
Unread 04-11-2012, 21:06
apples000's Avatar
apples000 apples000 is offline
Registered User
no team
 
Join Date: Mar 2012
Rookie Year: 2012
Location: United States
Posts: 222
apples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant future
Re: motor reverse direction

It depends on what you're trying to do. If you're controlling a motor like motor.set(0.5), then you would change that to motor.set(-0.5). If you're using the output forom a joystick you should change something like motor.set(stick.getX()) to motor.set(-stick.getX()). Where motor is the motor you are inverting, and stick is the joystick you use to control it.
If you are using inverting a drive motor, it is a little different. You must use the setInvertedMotor method of robot drive. You would add drive.setInvertedMotor(kFrontLeft, true) for each of the drive motors you wish to change and would replace drive with the name of your robot drive object. If you only plan on running the motor in one direction, you could just wire the motor to the speed controller in a different way.