-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCloseDoors.java
34 lines (29 loc) · 914 Bytes
/
CloseDoors.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package org.usfirst.frc.team4541.robot.commands;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import org.usfirst.frc.team4541.robot.Robot;
public class CloseDoors extends Command {
public CloseDoors() {
requires(Robot.gearbox);
setTimeout(1);
}
// Called just before this Command runs the first time
@Override
protected void initialize() {
Robot.gearbox.closeDoors();
}
// Called repeatedly when this Command is scheduled to run
protected void execute() {
}
// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return Robot.gearbox.isDoorsClosed() || isTimedOut();
}
// Called once after isFinished returns true
@Override
protected void end() {
Robot.gearbox.stopDoors();
SmartDashboard.putBoolean("DOOR OPEN", Robot.gearbox.isDoorsOpen());
}
}