public class Constants {
public static class OI {
- public final static int LEFT_STICK_PORT = 0;
- public final static int RIGHT_STICK_PORT = 1;
+ public final static int LEFT_STICK_PORT = 1;
+ public final static int RIGHT_STICK_PORT = 0;
}
public static class DriveTrain {
package org.usfirst.frc.team3501.robot;
+import org.usfirst.frc.team3501.robot.commands.driving.TimeDrive;
import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
import edu.wpi.first.wpilibj.IterativeRobot;
@Override
public void autonomousInit() {
+ Scheduler.getInstance().add(new TimeDrive(1.5, 0.4));
}
@Override
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.Command;
-/**
+/***
* This commands make the robot drive for a specified time with the motors set
* at a specified value between 1 and -1
*
* parameters:
* time: how long the robot should drive for - in seconds
* motorVal: the motor input to set the motors to
+ *
+ *
*/
public class TimeDrive extends Command {
Timer timer;
@Override
protected void initialize() {
timer.start();
- Robot.getDriveTrain().setMotorValues(motorVal, motorVal);
}
@Override
protected void execute() {
+ Robot.getDriveTrain().setMotorValues(motorVal, motorVal);
+
}
@Override
frontLeft.set(left);
rearLeft.set(left);
- frontRight.set(right);
- rearRight.set(right);
+ frontRight.set(-right);
+ rearRight.set(-right);
}
public void joystickDrive(final double thrust, final double twist) {
- robotDrive.arcadeDrive(thrust, twist);
+ robotDrive.arcadeDrive(thrust, twist, true);
}
public void stop() {