implement MoveIntakeArmToLevel command group
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / intakearm / MoveIntakeArmToLevel.java
1 package org.usfirst.frc.team3501.robot.commands.intakearm;
2
3 import org.usfirst.frc.team3501.robot.Robot;
4
5 import edu.wpi.first.wpilibj.command.CommandGroup;
6
7 /**
8 * This command group will move the arm to the specified level. Levels
9 * correspond to the angles stored in the potAngles array list saved in the
10 * IntakeArm subsystem. (starting from level 0)
11 *
12 * pre-condition: level >= 0 && level < potAngles.length
13 *
14 * post-condition: arm has moved to specified level
15 *
16 * @author Meryem
17 */
18 public class MoveIntakeArmToLevel extends CommandGroup {
19
20 public MoveIntakeArmToLevel(int level) {
21 requires(Robot.intakeArm);
22
23 if (level < 0 || level >= Robot.intakeArm.potAngles.length)
24 this.end();
25
26 addSequential(
27 new MoveIntakeArmToAngle(Robot.intakeArm.potAngles[level], 0));
28
29 }
30 }