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 | * | |
d8c3d26b AD |
10 | * Runs the intake continuously when button is pressed, and when button is not |
11 | * pressed does not run. | |
e911bc8e AD |
12 | * |
13 | * @author Meeta | |
14 | * | |
15 | */ | |
16 | public class RunIntakeContinuous extends Command { | |
17 | // create setter method for speed, use setSpeed method to do end() by setting | |
18 | // speed to 0 | |
19 | ||
20 | public RunIntakeContinuous() { | |
e52450a4 | 21 | requires(Robot.getIntake()); |
e911bc8e AD |
22 | } |
23 | ||
24 | @Override | |
25 | protected boolean isFinished() { | |
26 | // TODO Auto-generated method stub | |
27 | return true; | |
28 | } | |
29 | ||
30 | // Called just before this Command runs the first time | |
31 | @Override | |
32 | protected void initialize() { | |
33 | ||
34 | } | |
35 | ||
36 | // Called repeatedly when this Command is scheduled to run | |
37 | @Override | |
38 | protected void execute() { | |
e52450a4 | 39 | Robot.getIntake().setSpeed(Robot.getIntake().INTAKE_SPEED); |
e911bc8e AD |
40 | } |
41 | ||
42 | // Called once after isFinished returns true | |
43 | @Override | |
44 | protected void end() { | |
45 | Intake.intake.setSpeed(0); | |
46 | } | |
47 | ||
48 | // Called when another command which requires one or more of the same | |
49 | // subsystems is scheduled to run | |
50 | @Override | |
51 | protected void interrupted() { | |
52 | end(); | |
53 | } | |
54 | ||
55 | } |