View Single Post
  #2   Spotlight this post!  
Unread 13-01-2012, 09:18
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Coding for CIM Motor help

Typically teams use tank drive but it is really personal choice, i belive you could simplify your code a bit to by using:

Your Mainclass:

Code:
RobotDrive drive;
Joystick left, right;
robotInit:
Code:
drive = new RobotDrive(1,2,3,4); // Four motors on pwm You can replace with CANJaguars too.
right = new Joystick(1);
left = new Joystick(2);
operatorControl:
Code:
drive.tankDrive(left.getY(), right.getY());
For arcade:
Code:
drive.arcadeDrive(left.getY(), left.getX()); // your Y val is your speed and the X value is your turning
You may have to import classes if so just right click the underlined errors and click fix imports

Last edited by ProgrammerMatt : 13-01-2012 at 09:21.
Reply With Quote