From: Garima Kapila Date: Sat, 30 Jan 2016 05:12:04 +0000 (-0800) Subject: Add intakearm constants and intake arm methods including initial dropping and also... X-Git-Url: http://challenge-bot.com/repos/?a=commitdiff_plain;h=29f5cd04afc186a83f86223c2d4084214c67acee;p=3501%2Fstronghold-2016 Add intakearm constants and intake arm methods including initial dropping and also intake and output methods --- diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index 43dd6201..b8ecff04 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -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; } diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java b/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java index f27eb665..a3a5be0a 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java @@ -1,15 +1,40 @@ package org.usfirst.frc.team3501.robot.subsystems; +import org.usfirst.frc.team3501.robot.Constants; + +import edu.wpi.first.wpilibj.CANTalon; import edu.wpi.first.wpilibj.command.Subsystem; public class IntakeArm extends Subsystem { - public IntakeArm() { + private CANTalon intake; + + public IntakeArm() { + intake = new CANTalon(Constants.IntakeArm.PORT); + + } + + /* + * Intake only moves once at the beginning of the match. It lowers at the + * beginning of the match and is held there by mechanical stops until the end + * of the match. + * + * Must be used in a command that has a timer variable to stop it. + */ + public void dropIntake() { + intake.set(0.3); + } + + public void intake() { + intake.set(Constants.IntakeArm.INTAKE_SPEED); + } - } + public void output() { + intake.set(Constants.IntakeArm.OUTPUT_SPEED); + } - @Override - protected void initDefaultCommand() { + @Override + protected void initDefaultCommand() { - } + } }