Add thumb button to send to RioLog/Drive console the current speed of the shooter...
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / ShooterTest.java
1 package org.usfirst.frc.team3501.robot.commands;
2
3 import org.usfirst.frc.team3501.robot.Robot;
4
5 import edu.wpi.first.wpilibj.command.Command;
6
7 /**
8 *
9 */
10 public class ShooterTest extends Command {
11
12 public ShooterTest() {
13
14 requires(Robot.shooter);
15 }
16
17 @Override
18 protected void initialize() {
19
20 Robot.shooter.setSpeed(0.5);
21
22 }
23
24 @Override
25 protected void execute() {
26 boolean triggerPressed = Robot.oi.rightJoystick.getTrigger();
27 boolean leftSidePressed = Robot.oi.leftSilverButton.get();
28 boolean rightSidePressed = Robot.oi.rightSilverButton.get();
29 boolean thumbPressed = Robot.oi.thumbButton.get();
30
31 double currentWheelSpeed = Robot.shooter.getCurrentSpeed();
32
33 if (triggerPressed == true) {
34 Robot.shooter.setSpeed(currentWheelSpeed);
35 } else {
36 Robot.shooter.setSpeed(0.0);
37 }
38
39 if (leftSidePressed == true) {
40 Robot.shooter.decrementSpeed(0.1);
41 }
42
43 if (rightSidePressed == true) {
44 Robot.shooter.incrementSpeed(0.1);
45 }
46
47 if (thumbPressed == true) {
48 System.out.println(Robot.shooter.getCurrentSpeed());
49 }
50
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 }