Commit | Line | Data |
---|---|---|
33141cdd KZ |
1 | package org.usfirst.frc.team3501.robot.commands.driving; |
2 | ||
f8bfcc62 | 3 | import org.usfirst.frc.team3501.robot.OI; |
33141cdd KZ |
4 | import org.usfirst.frc.team3501.robot.Robot; |
5 | ||
6 | import edu.wpi.first.wpilibj.command.Command; | |
7 | ||
8 | /** | |
1c94f230 | 9 | * Runs throughout teleop and listens for joystick inputs and drives the |
571a0e2a | 10 | * driveTrain Never finishes until teleop ends |
33141cdd KZ |
11 | */ |
12 | public class JoystickDrive extends Command { | |
13 | ||
14 | public JoystickDrive() { | |
15 | requires(Robot.driveTrain); | |
16 | } | |
17 | ||
18 | @Override | |
19 | protected void initialize() { | |
20 | } | |
21 | ||
22 | @Override | |
23 | protected void execute() { | |
f8bfcc62 HD |
24 | double left = -OI.leftJoystick.getY(); |
25 | double right = -OI.rightJoystick.getY(); | |
43338192 | 26 | Robot.driveTrain.joystickDrive(left, right); |
33141cdd KZ |
27 | } |
28 | ||
29 | @Override | |
30 | protected boolean isFinished() { | |
31 | return false; | |
32 | } | |
33 | ||
34 | @Override | |
35 | protected void end() { | |
36 | Robot.driveTrain.stop(); | |
37 | } | |
38 | ||
39 | @Override | |
40 | protected void interrupted() { | |
33141cdd KZ |
41 | } |
42 | } |