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() { | |
7f12e817 | 19 | |
8e5f83d9 | 20 | Robot.shooter.setSpeed(0.5); |
7f12e817 | 21 | |
38b0db52 E |
22 | } |
23 | ||
38b0db52 E |
24 | @Override |
25 | protected void execute() { | |
cb3389eb E |
26 | boolean triggerPressed = Robot.oi.rightJoystick.getTrigger(); |
27 | boolean leftSidePressed = Robot.oi.leftSilverButton.get(); | |
28 | boolean rightSidePressed = Robot.oi.rightSilverButton.get(); | |
7f12e817 | 29 | |
7a949394 | 30 | boolean thumbPressed = Robot.oi.thumbButton.get(); |
cb3389eb E |
31 | |
32 | double currentWheelSpeed = Robot.shooter.getCurrentSpeed(); | |
33 | ||
7a949394 | 34 | if (triggerPressed == true) { |
cb3389eb E |
35 | Robot.shooter.setSpeed(currentWheelSpeed); |
36 | } else { | |
37 | Robot.shooter.setSpeed(0.0); | |
38 | } | |
39 | ||
7a949394 | 40 | if (leftSidePressed == true) { |
8e5f83d9 | 41 | Robot.shooter.decrementSpeed(0.1); |
cb3389eb E |
42 | } |
43 | ||
7a949394 | 44 | if (rightSidePressed == true) { |
8e5f83d9 | 45 | Robot.shooter.incrementSpeed(0.1); |
cb3389eb E |
46 | } |
47 | ||
7a949394 E |
48 | if (thumbPressed == true) { |
49 | System.out.println(Robot.shooter.getCurrentSpeed()); | |
50 | } | |
38b0db52 E |
51 | } |
52 | ||
53 | // Make this return true when this Command no longer needs to run execute() | |
54 | @Override | |
55 | protected boolean isFinished() { | |
56 | return false; | |
57 | } | |
58 | ||
59 | // Called once after isFinished returns true | |
60 | @Override | |
61 | protected void end() { | |
62 | } | |
63 | ||
64 | // Called when another command which requires one or more of the same | |
65 | // subsystems is scheduled to run | |
66 | @Override | |
67 | protected void interrupted() { | |
68 | } | |
69 | } |