Add intakearm constants and intake arm methods including initial dropping and also...
authorGarima Kapila <garima.kapila369@gmail.com>
Sat, 30 Jan 2016 05:12:04 +0000 (21:12 -0800)
committerGarima Kapila <garima.kapila369@gmail.com>
Sun, 31 Jan 2016 00:35:32 +0000 (16:35 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java

index 43dd6201843966fd0254dc8b7c21fce7be3d215d..b8ecff049eefddba5d43865f188b196b5b88846d 100644 (file)
@@ -56,6 +56,13 @@ public class Constants {
     }
   }
 
+  public static class IntakeArm {
+    public static final int PORT = 0;
+
+    public static final double INTAKE_SPEED = 0.5;
+    public static final double OUTPUT_SPEED = -0.5;
+  }
+
   public static enum Direction {
     LEFT, RIGHT, DOWN, UP, FORWARD, BACKWARD;
   }
index f27eb665efc8647e8ae66291f2661c36f0638957..a3a5be0af181c6b129bdf0e8b52501db155fbfd2 100755 (executable)
@@ -1,15 +1,40 @@
 package org.usfirst.frc.team3501.robot.subsystems;\r
 \r
+import org.usfirst.frc.team3501.robot.Constants;\r
+\r
+import edu.wpi.first.wpilibj.CANTalon;\r
 import edu.wpi.first.wpilibj.command.Subsystem;\r
 \r
 public class IntakeArm extends Subsystem {\r
 \r
-       public IntakeArm() {\r
+  private CANTalon intake;\r
+\r
+  public IntakeArm() {\r
+    intake = new CANTalon(Constants.IntakeArm.PORT);\r
+\r
+  }\r
+\r
+  /*\r
+   * Intake only moves once at the beginning of the match. It lowers at the\r
+   * beginning of the match and is held there by mechanical stops until the end\r
+   * of the match.\r
+   * \r
+   * Must be used in a command that has a timer variable to stop it.\r
+   */\r
+  public void dropIntake() {\r
+    intake.set(0.3);\r
+  }\r
+\r
+  public void intake() {\r
+    intake.set(Constants.IntakeArm.INTAKE_SPEED);\r
+  }\r
 \r
-       }\r
+  public void output() {\r
+    intake.set(Constants.IntakeArm.OUTPUT_SPEED);\r
+  }\r
 \r
-       @Override\r
-       protected void initDefaultCommand() {\r
+  @Override\r
+  protected void initDefaultCommand() {\r
 \r
-       }\r
+  }\r
 }\r