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 2020import org .usfirst .frc .team199 .Robot2018 .commands .ShiftDriveType ;
2121import org .usfirst .frc .team199 .Robot2018 .commands .ShiftHighGear ;
2222import org .usfirst .frc .team199 .Robot2018 .commands .ShiftLowGear ;
23+ import org .usfirst .frc .team199 .Robot2018 .commands .StopIntake ;
2324import org .usfirst .frc .team199 .Robot2018 .commands .ToggleLeftIntake ;
2425import org .usfirst .frc .team199 .Robot2018 .commands .ToggleRightIntake ;
2526import 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 }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments