Quote:
Originally Posted by Joe Ross
You are calling these methods before creating the leftEncoder and rightEncoder objects, which is causing the code to crash. If you scroll up in the output window, you will see a stack trace which would point to those lines.
|
So changing the code to this should in theory stop causing the code to crash:
Code:
public void robotInit() {
driveStick = new Joystick(1);
mainDrive = new RobotDrive(1,2,3,4);
rightEncoder = new Encoder(1,2);
leftEncoder = new Encoder(3,4);
leftEncoder.setDistancePerPulse(0.000623);
rightEncoder.setDistancePerPulse(0.000623);
RDistance = rightEncoder.getDistance();
LDistance = leftEncoder.getDistance();
DB1 = driveStick.getRawButton(1);
}
Unfortunately I don't have the output from the Crio anymore but I understand how that would cause a problem.