This repository was archived by the owner on Sep 14, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Robot2018/src/org/usfirst/frc/team199/Robot2018 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ protected boolean isFinished() {
5454 // Called once after isFinished returns true
5555 @ Override
5656 protected void end () {
57+ Robot .intakeEject .stopIntake ();
5758 }
5859
5960 // Called when another command which requires one or more of the same
Original file line number Diff line number Diff line change 22
33import org .usfirst .frc .team199 .Robot2018 .Robot ;
44
5- import edu .wpi .first .wpilibj .command .InstantCommand ;
5+ import edu .wpi .first .wpilibj .Timer ;
6+ import edu .wpi .first .wpilibj .command .Command ;
67
78/**
89 *
910 */
10- public class StopIntake extends InstantCommand {
11+ public class StopIntake extends Command {
12+
13+ private Timer tim ;
1114
1215 public StopIntake () {
1316 // Use requires() here to declare subsystem dependencies
1417 // eg. requires(chassis);
1518 super ();
19+ // requires(Robot.intakeEject);
1620 }
1721
1822 // Called just before this Command runs the first time
1923 @ Override
2024 protected void initialize () {
25+ tim = new Timer ();
26+ tim .reset ();
27+ tim .start ();
28+ }
29+
30+ @ Override
31+ protected void execute () {
2132 Robot .intakeEject .stopIntake ();
2233 }
34+
35+ @ Override
36+ protected boolean isFinished () {
37+ // TODO Auto-generated method stub
38+ return tim .get () > 3 ;
39+ }
2340}
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public class IntakeEject extends Subsystem implements IntakeEjectInterface {
2121 private final DoubleSolenoid rightSolenoid = RobotMap .rightIntakeSolenoid ;
2222 private boolean leftOpen = isOpen (leftSolenoid .get ());
2323 private boolean rightOpen = isOpen (rightSolenoid .get ());
24+ private boolean hasCube = false ;
2425
2526 /**
2627 * Return whether or not a side of the intake (L/R) is open
You can’t perform that action at this time.
0 commit comments