Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit cf83e64

Browse files
stopintake doesn't work
1 parent e7b22d9 commit cf83e64

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/IntakeCube.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/StopIntake.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,39 @@
22

33
import 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
}

Robot2018/src/org/usfirst/frc/team199/Robot2018/subsystems/IntakeEject.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)