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.
test.java (594 Bytes)
test.java (594 Bytes)
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:
RobotDrive drive;
Joystick left, right;
robotInit:
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:
drive.tankDrive(left.getY(), right.getY());
For arcade:
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
If you’re using NetBeans, there is a shortcut (default Ctrl+Shift+I) which automatically fixes imports. VERY handy.
Yes true and i <3 netbeans