add methods and constants to stop/start rollers
authorLauren Meier <meier.lauren@gmail.com>
Wed, 10 Feb 2016 03:03:38 +0000 (19:03 -0800)
committerLauren Meier <meier.lauren@gmail.com>
Sat, 13 Feb 2016 22:38:59 +0000 (14:38 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/commands/ToggleBallRollerExpel.java
src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java

index d4ae7b2ebfec2f7a3a0719ea930a8885e8091f17..c366b53c6c7b35c5f360fa35306abd7f73bbaa24 100644 (file)
@@ -77,6 +77,7 @@ public class Constants {
     public static final int POT_CHANNEL = 0;
     public static final double INTAKE_SPEED = 0.5;
     public static final double OUTPUT_SPEED = -0.5;
+    public static final double STOP_SPEED = 0.0;
     public final static double FULL_RANGE = 270.0; // in degrees
     public final static double OFFSET = -135.0; // in degrees
     public static final double ZERO_ANGLE = 0;
index 271c79ecb27b60b6e4c729eb1bfe67b57008d135..66ee1d6dcd48161ef7cbbc0f8dfccc4a781a9715 100644 (file)
@@ -5,14 +5,16 @@ import org.usfirst.frc.team3501.robot.Robot;
 import edu.wpi.first.wpilibj.command.Command;
 
 public class ToggleBallRollerExpel extends Command {
-  final double BALL_INTAKE_SPEED = 0.3;
 
   public ToggleBallRollerExpel() {
   }
 
   @Override
   protected void initialize() {
-    Robot.shooter.setSpeed(BALL_INTAKE_SPEED);
+    if (Robot.intakeArm.areRollersRolling())
+      Robot.intakeArm.stopRollers();
+    else
+      Robot.intakeArm.intakeBall();
   }
 
   @Override
index afcc16f6a3f719a8d883f021dc8c1c4f0dc69fb2..a707777e96d7ac9bae06e4105f8a349323658957 100755 (executable)
@@ -48,6 +48,10 @@ public class IntakeArm extends Subsystem {
     intakeRoller.set(Constants.IntakeArm.OUTPUT_SPEED);
   }
 
+  public void stopRollers() {
+    intakeRoller.set(Constants.IntakeArm.STOP_SPEED);
+  }
+
   /***
    * This method gets you the current voltage of the motor that controls the
    * intake arm roller. The range of voltage is from [-1,1]. A negative voltage