Skip to content

Commit

Permalink
make it so arms can't go down until they go up
Browse files Browse the repository at this point in the history
  • Loading branch information
team6101 committed Mar 7, 2024
1 parent d0fbd37 commit ee10acf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
12 changes: 10 additions & 2 deletions src/main/java/frc/robot/InputtedCoDriverControls.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ public static void setCoDriverController(XboxController xboxController) {
controller = xboxController;
}

public static void onTeleopInit() {
hasGoneUp = false;
}

/**Prevents the codriver from accidentally moving the arms down */
static boolean hasGoneUp = false;

public static void onEveryFrame() {
if (controller.getYButtonPressed()) {
Shooter.startFeedMotors();
Expand All @@ -26,7 +33,7 @@ public static void onEveryFrame() {
Shooter.stopShooterMotors();
}

if (controller.getLeftBumperPressed()) {
if (controller.getLeftBumper()) {
Intake.startFloorIntake();
}
if (controller.getLeftBumperReleased()) {
Expand All @@ -35,7 +42,8 @@ public static void onEveryFrame() {

if (controller.getStartButton()) {
Climber.manualExtendArms();
} else if (controller.getBackButton()) {
hasGoneUp = true;
} else if (controller.getBackButton() && hasGoneUp) {
Climber.manualRetractArms();
} else {
Climber.stopClimbMotors();
Expand Down
12 changes: 3 additions & 9 deletions src/main/java/frc/robot/InputtedDriverControls.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,9 @@ public static void onEveryFrame() {
}
}

private static void stopAtShootingDistance() {
throw new UnsupportedOperationException("Unimplemented method 'stopAtShootingDistance'");
}
private static void stopAtShootingDistance() {}

private static void stopAtAmpShootingDistance() {
throw new UnsupportedOperationException("Unimplemented method 'stopAtAmpShootingDistance'");
}
private static void stopAtAmpShootingDistance() {}

private static void stopAtFeedingDistance() {
throw new UnsupportedOperationException("Unimplemented method 'stopAtFeedingDistance'");
}
private static void stopAtFeedingDistance() {}
}

0 comments on commit ee10acf

Please sign in to comment.