Thread: CANJaguar
View Single Post
  #13   Spotlight this post!  
Unread 20-01-2012, 19:16
Kodiak's Avatar
Kodiak Kodiak is offline
Registered User
AKA: Boston
FRC #3325 (Chaos Order)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Texas
Posts: 13
Kodiak is an unknown quantity at this point
Re: CANJaguar

Quote:
Originally Posted by CodeYeti View Post
Besides variables going out of scope, the code you have posed there would do ok. To answer your question about creating Jaguar instances, you can create a RobotDrive both ways
Code:
RobotDrive(int frontLeftMotor, int rearLeftMotor, int frontRightMotor, int rearRightMotor);

/* OR */

RobotDrive(SpeedController frontLeftMotor, SpeedController rearLeftMotor, SpeedController frontRightMotor, SpeedController rearRightMotor);
And whether you have CANJaguars or regular Jaguars all depends on how you have them hooked up. chances are, you have normal Jaguars. If you are using a PWM cable to hook the Jaguars to the digital module/sidecar, then you have regular Jaguars for sure.

EDIT: Also, its more common to use the y axis of each joystick to control motor speeds than it is the throttle, but obviously you can do whatever you wish.
I agree, just threw this code together to please the Electrical crew, I planed to correctly do it being that I have more time
Reply With Quote