|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Coding for CIM Motor help
Hello, I am the new programmer for my team, but I'm not all that great yet.
Right now I have to code to make our CIM motor's drive. I have to make it so that the left motors are controlled by the left joystick and right motors to be controlled by the right joy stick. This is my question. I've been coding for tank drive, but would arcade be easier? This is the code I have. |
|
#2
|
|||
|
|||
|
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; 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); Code:
drive.tankDrive(left.getY(), right.getY()); Code:
drive.arcadeDrive(left.getY(), left.getX()); // your Y val is your speed and the X value is your turning Last edited by ProgrammerMatt : 13-01-2012 at 09:21. |
|
#3
|
||||
|
||||
|
Re: Coding for CIM Motor help
If you're using NetBeans, there is a shortcut (default Ctrl+Shift+I) which automatically fixes imports. VERY handy.
|
|
#4
|
|||
|
|||
|
Re: Coding for CIM Motor help
Yes true and i <3 netbeans
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|