--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.intakearm;
+
+import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.CANTalon;
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command runs the given motor (intended to be an intake arm motor) at the
+ * given speed momentarily.
+ *
+ * @author harel, garima
+ *
+ */
+
+public class RunIntakeMotor extends Command {
+ CANTalon intakeMotor;
+ double motorSpeed;
+
+ /***
+ * @param intakeMotor
+ * Motor to run.
+ * @param motorSpeed
+ * Speed at which to run motor. Range is [-1,1]
+ */
+ public RunIntakeMotor(CANTalon intakeMotor, double motorSpeed) {
+ requires(Robot.intakeArm);
+ this.intakeMotor = intakeMotor;
+ this.motorSpeed = motorSpeed;
+ }
+
+ @Override
+ protected void initialize() {
+ intakeMotor.set(motorSpeed);
+ }
+
+ @Override
+ protected void execute() {
+
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ intakeMotor.set(Constants.IntakeArm.STOP_INTAKE_ARM_SPEED);
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+}