// RobotBuilder Version: 2.0
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// Java from RobotBuilder. Do not put any code or make any change in
// the blocks indicating autogenerated code or it will be lost on an
// update. Deleting the comments indicating the section will prevent
// it from being updated in the future.

package org.usfirst.frc2906.SpanawayLakeSentinels.subsystems;

import org.usfirst.frc2906.SpanawayLakeSentinels.Robot;
import org.usfirst.frc2906.SpanawayLakeSentinels.RobotMap;
import org.usfirst.frc2906.SpanawayLakeSentinels.commands.*;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Timer;

import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.Encoder;

/**
 *
 */
public class DriveTrain extends Subsystem {

	Encoder encLD = RobotMap.encoderLeft;
	Encoder encRD = RobotMap.encoderRight;

	// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS

	// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS

	// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS

	private final RobotDrive robotDrive21 = RobotMap.driveTrainRobotDrive21;

	// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS

	// Put methods for controlling this subsystem
	// here. Call these from Commands.

	public void initDefaultCommand() {
		// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND

		// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND

		// Set the default command for a subsystem here.
		// setDefaultCommand(new MySpecialCommand());
		setDefaultCommand(new DriveWithJoysticks());
	}

	public void arcadeDrive(double move, double rotate) {
		robotDrive21.arcadeDrive((move * -1), rotate);
	}

	public void midStart() {
		Robot.driveTrain.arcadeDrive(.1, .8);
		Timer.delay(5);
		Robot.driveTrain.arcadeDrive(0, 0);
	}

	public void leftStart() {
		Robot.driveTrain.arcadeDrive(0, 0);
		Timer.delay(20);
		Robot.driveTrain.arcadeDrive(0, 0);
	}

	public void rightStart() {
		Robot.driveTrain.arcadeDrive(0, 0);
		Timer.delay(20);
		Robot.driveTrain.arcadeDrive(0, 0);
	}

	public void straightStart() {
		Robot.driveTrain.arcadeDrive(0, 0);
		Timer.delay(20);
		Robot.driveTrain.arcadeDrive(0, 0);
	}

	public void resetEncs() {
		encLD.reset();
		encRD.reset();
	}

	public void resetEncR() {
		encRD.reset();
	}

	public void resetEncL() {
		encLD.reset();
	}

	public void drive(double speed, double move) {
		Robot.driveTrain.arcadeDrive(speed, move);

	}

	public void runEncs(int encoderValue, double speed, double move) {
		Robot.driveTrain.drive(speed, move);
		// int encLDValue = encLD.get();
		if (encLD.equals(encoderValue));
		{
			Robot.driveTrain.arcadeDrive(0.0, 0.0);

		}

	}
}

Add files via upload