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

Commit e6c1538

Browse files
stop intake button: manip btn 7
1 parent 0777385 commit e6c1538

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

Robot2018/src/org/usfirst/frc/team199/Robot2018/OI.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.usfirst.frc.team199.Robot2018.commands.ShiftDriveType;
2121
import org.usfirst.frc.team199.Robot2018.commands.ShiftHighGear;
2222
import org.usfirst.frc.team199.Robot2018.commands.ShiftLowGear;
23+
import org.usfirst.frc.team199.Robot2018.commands.StopIntake;
2324
import org.usfirst.frc.team199.Robot2018.commands.ToggleLeftIntake;
2425
import org.usfirst.frc.team199.Robot2018.commands.ToggleRightIntake;
2526
import org.usfirst.frc.team199.Robot2018.commands.UpdatePIDConstants;
@@ -61,6 +62,7 @@ public class OI {
6162
private JoystickButton outakeCubeButton;
6263
private JoystickButton toggleLeftIntakeButton;
6364
private JoystickButton toggleRightIntakeButton;
65+
private JoystickButton stopIntakeButton;
6466

6567
public int getButton(String key, int def) {
6668
if (!SmartDashboard.containsKey("Button/" + key)) {
@@ -131,6 +133,9 @@ public OI(Robot robot) {
131133
toggleLeftIntakeButton.whenPressed(new ToggleLeftIntake());
132134
toggleRightIntakeButton = new JoystickButton(manipulator, getButton("Toggle Right Intake Button", 4));
133135
toggleRightIntakeButton.whenPressed(new ToggleRightIntake());
136+
137+
stopIntakeButton = new JoystickButton(manipulator, getButton("Stop Intake Button", 7));
138+
stopIntakeButton.whenPressed(new StopIntake());
134139
}
135140

136141
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package org.usfirst.frc.team199.Robot2018.commands;
2+
3+
import org.usfirst.frc.team199.Robot2018.Robot;
4+
5+
import edu.wpi.first.wpilibj.command.InstantCommand;
6+
7+
/**
8+
*
9+
*/
10+
public class StopIntake extends InstantCommand {
11+
12+
public StopIntake() {
13+
// Use requires() here to declare subsystem dependencies
14+
// eg. requires(chassis);
15+
super();
16+
}
17+
18+
// Called just before this Command runs the first time
19+
@Override
20+
protected void initialize() {
21+
Robot.intakeEject.stopIntake();
22+
}
23+
}

0 commit comments

Comments
 (0)