Ok so I have read over all those documents and followed the getting started with Java guide to put together some code using simple robot template.
here is my code:
Quote:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
public class TankDrive extends SimpleRobot {
RobotDrive drive = new RobotDrive(1,2,3,4);
Joystick leftStick = new Joystick(1);
Joystick rightStick = new Joystick(2);
public void operatorControl()
{
while(isOperatorControl() && isEnabled())
{
drive.tankDrive(leftStick, rightStick);
}
}
}
|
I basically just copied the quick start guide...
Some questions:
1) is this code even going to do anything?
2) when you create the joystick objects and put (1) and (2) for ports, how does the computer know that joysticks are connected? Same for the motors, is just putting 1,2,3,4 for the 4 motors going to work? (I guess I just don't fully understand what ports we are connecting the motors and the joysticks to)
3) I think our team is planning on using the command based template when we code for the full robot, how do I implement this type of thing using the subsystem, command base, OI, and all of the different java files that go along with it? (It seems like the different parts need to be split up in order to work properly)