Thread: Inverse Motors?
View Single Post
  #2   Spotlight this post!  
Unread 16-02-2012, 13:43
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: Inverse Motors?

Use the RobotDrive::SetInvertedMotor(RobotDrive::MotorType , bool) function.

Something like:
Code:
//joystick - fill in usb port number
Joystick joy;
//declare jags - fill in ports in constructors
Jaguar left_front, left_rear, right_front, right_rear;
//declare RobotDrive object
RobotDrive drive(left_front, left_rear, right_front, right_rear);
//set motor inversion
drive.SetInvertedMotor(RobotDrive::kFrontLeftMotor, false);
drive.SetInvertedMotor(RobotDrive::kFrontRightMotor, true);
drive.SetInvertedMotor(RobotDrive::kRearLeftMotor, false);
drive.SetInvertedMotor(RobotDrive::kRearRightMotor, true);
//drive
while (true) {
   drive.ArcadeDrive(joy);
}

Last edited by rbmj : 16-02-2012 at 13:45.
Reply With Quote