Ok, that makes sense. Then would this (below) be how you would use threads with the simple robot template. Would you still need a while loop or once you start the thread it will keep running and call the Runnable. Thanks.
Code:
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 RobotTemplate extends SimpleRobot
{
Joystick stickL = new Joystick(1);
Joystick stickR = new Joystick(2);
public void autonomous()
{
}
public void operatorControl()
{
Thread drive = new Thread(driveJob);
drive.start();
}
Runnable driveJob = new Runnable()
{
RobotDrive myDrive = new RobotDrive(1, 2, 3, 4);
public void run()
{
myDrive.tankDrive(-stickL.getAxis(Joystick.AxisType.kY), -stickR.getAxis(Joystick.AxisType.kY));
}
};
}