Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Inverse Motors? (http://www.chiefdelphi.com/forums/showthread.php?t=102995)

KyleS 16-02-2012 13:31

Inverse Motors?
 
First time working with the WPIlib, not exactly sure how to inverse the motors when using the simple Arcade drive. Any ideas?

rbmj 16-02-2012 13:43

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);
}


KyleS 16-02-2012 13:54

Re: Inverse Motors?
 
Exactly what I needed, thanks! Now all I need to do is figure out why the Axis Camera isn't working.


All times are GMT -5. The time now is 17:36.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi