Commit | Line | Data |
---|---|---|
e911bc8e AD |
1 | package org.usfirst.frc.team3501.robot.commands.intake; |
2 | ||
e52450a4 | 3 | import org.usfirst.frc.team3501.robot.Robot; |
e911bc8e AD |
4 | import org.usfirst.frc.team3501.robot.subsystems.Intake; |
5 | ||
6 | import edu.wpi.first.wpilibj.command.Command; | |
7 | ||
8 | /*** | |
9 | * | |
10 | * Runs the intake continuously. | |
11 | * | |
12 | * @author Meeta | |
13 | * | |
14 | */ | |
15 | public class RunIntakeContinuous extends Command { | |
16 | // create setter method for speed, use setSpeed method to do end() by setting | |
17 | // speed to 0 | |
18 | ||
19 | public RunIntakeContinuous() { | |
e52450a4 | 20 | requires(Robot.getIntake()); |
e911bc8e AD |
21 | } |
22 | ||
23 | @Override | |
24 | protected boolean isFinished() { | |
25 | // TODO Auto-generated method stub | |
26 | return true; | |
27 | } | |
28 | ||
29 | // Called just before this Command runs the first time | |
30 | @Override | |
31 | protected void initialize() { | |
32 | ||
33 | } | |
34 | ||
35 | // Called repeatedly when this Command is scheduled to run | |
36 | @Override | |
37 | protected void execute() { | |
e52450a4 | 38 | Robot.getIntake().setSpeed(Robot.getIntake().INTAKE_SPEED); |
e911bc8e AD |
39 | } |
40 | ||
41 | // Called once after isFinished returns true | |
42 | @Override | |
43 | protected void end() { | |
44 | Intake.intake.setSpeed(0); | |
45 | } | |
46 | ||
47 | // Called when another command which requires one or more of the same | |
48 | // subsystems is scheduled to run | |
49 | @Override | |
50 | protected void interrupted() { | |
51 | end(); | |
52 | } | |
53 | ||
54 | } |