5d8ff9c9fee2930869a2a48af3244a0d92b66289
1 package org
.usfirst
.frc
.team3501
.robot
.commands
.driving
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import edu
.wpi
.first
.wpilibj
.command
.Command
;
8 * Runs throughout teleop and listens for joystick inputs and drives the
10 * Never finishes until teleop ends
12 public class JoystickDrive
extends Command
{
14 public JoystickDrive() {
15 requires(Robot
.driveTrain
);
19 protected void initialize() {
23 protected void execute() {
24 // IDK why but the joystick gives positive values for pulling backwards
25 double left
= -Robot
.oi
.leftJoystick
.getY();
26 double right
= -Robot
.oi
.rightJoystick
.getY();
27 Robot
.driveTrain
.drive(left
, right
);
31 protected boolean isFinished() {
36 protected void end() {
37 Robot
.driveTrain
.stop();
41 protected void interrupted() {