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
index 216660717eda90407af2b7e82a014094869ef778..44a3686817620031770f3bd50df74bb08433d875 100644 (file)
@@ -1,7 +1,6 @@
 package org.usfirst.frc.team3501.robot.commands;
 
-import org.usfirst.frc.team3501.robot.OI;
-import org.usfirst.frc.team3501.robot.subsystems.Shooter;
+import org.usfirst.frc.team3501.robot.Robot;
 
 import edu.wpi.first.wpilibj.command.Command;
 
@@ -9,24 +8,46 @@ import edu.wpi.first.wpilibj.command.Command;
  *
  */
 public class ShooterTest extends Command {
-  public static Shooter shooter;
-  public static OI oi;
 
   public ShooterTest() {
-    // Use requires() here to declare subsystem dependencies
-    // eg. requires(chassis);
-    requires(shooter);
+
+    requires(Robot.shooter);
   }
 
-  // Called just before this Command runs the first time
   @Override
   protected void initialize() {
 
+    Robot.shooter.setSpeed(0.5);
+
   }
 
-  // Called repeatedly when this Command is scheduled to run
   @Override
   protected void execute() {
+    boolean triggerPressed = Robot.oi.rightJoystick.getTrigger();
+    boolean leftSidePressed = Robot.oi.leftSilverButton.get();
+    boolean rightSidePressed = Robot.oi.rightSilverButton.get();
+    boolean thumbPressed = Robot.oi.thumbButton.get();
+
+    double currentWheelSpeed = Robot.shooter.getCurrentSpeed();
+
+    if (triggerPressed == true) {
+      Robot.shooter.setSpeed(currentWheelSpeed);
+    } else {
+      Robot.shooter.setSpeed(0.0);
+    }
+
+    if (leftSidePressed == true) {
+      Robot.shooter.decrementSpeed(0.1);
+    }
+
+    if (rightSidePressed == true) {
+      Robot.shooter.incrementSpeed(0.1);
+    }
+
+    if (thumbPressed == true) {
+      System.out.println(Robot.shooter.getCurrentSpeed());
+    }
+
   }
 
   // Make this return true when this Command no longer needs to run execute()