Commit | Line | Data |
---|---|---|
38b0db52 E |
1 | package org.usfirst.frc.team3501.robot.commands; |
2 | ||
cb3389eb | 3 | import org.usfirst.frc.team3501.robot.Robot; |
38b0db52 E |
4 | |
5 | import edu.wpi.first.wpilibj.command.Command; | |
6 | ||
7 | /** | |
8 | * | |
9 | */ | |
10 | public class ShooterTest extends Command { | |
38b0db52 E |
11 | |
12 | public ShooterTest() { | |
cb3389eb E |
13 | |
14 | requires(Robot.shooter); | |
38b0db52 E |
15 | } |
16 | ||
38b0db52 E |
17 | @Override |
18 | protected void initialize() { | |
8e5f83d9 | 19 | Robot.shooter.setSpeed(0.5); |
38b0db52 E |
20 | } |
21 | ||
38b0db52 E |
22 | @Override |
23 | protected void execute() { | |
cb3389eb E |
24 | boolean triggerPressed = Robot.oi.rightJoystick.getTrigger(); |
25 | boolean leftSidePressed = Robot.oi.leftSilverButton.get(); | |
26 | boolean rightSidePressed = Robot.oi.rightSilverButton.get(); | |
7a949394 | 27 | boolean thumbPressed = Robot.oi.thumbButton.get(); |
cb3389eb E |
28 | |
29 | double currentWheelSpeed = Robot.shooter.getCurrentSpeed(); | |
30 | ||
7a949394 | 31 | if (triggerPressed == true) { |
cb3389eb E |
32 | Robot.shooter.setSpeed(currentWheelSpeed); |
33 | } else { | |
34 | Robot.shooter.setSpeed(0.0); | |
35 | } | |
36 | ||
7a949394 | 37 | if (leftSidePressed == true) { |
8e5f83d9 | 38 | Robot.shooter.decrementSpeed(0.1); |
cb3389eb E |
39 | } |
40 | ||
7a949394 | 41 | if (rightSidePressed == true) { |
8e5f83d9 | 42 | Robot.shooter.incrementSpeed(0.1); |
cb3389eb E |
43 | } |
44 | ||
7a949394 E |
45 | if (thumbPressed == true) { |
46 | System.out.println(Robot.shooter.getCurrentSpeed()); | |
47 | } | |
48 | ||
38b0db52 E |
49 | } |
50 | ||
51 | // Make this return true when this Command no longer needs to run execute() | |
52 | @Override | |
53 | protected boolean isFinished() { | |
54 | return false; | |
55 | } | |
56 | ||
57 | // Called once after isFinished returns true | |
58 | @Override | |
59 | protected void end() { | |
60 | } | |
61 | ||
62 | // Called when another command which requires one or more of the same | |
63 | // subsystems is scheduled to run | |
64 | @Override | |
65 | protected void interrupted() { | |
66 | } | |
67 | } |