Skip to content

Commit

Permalink
Merge pull request #50 from frc937/limit-switch-workaround
Browse files Browse the repository at this point in the history
Limit switch workaround
  • Loading branch information
Jack-Haefele authored Feb 12, 2024
2 parents 917a56e + d622eba commit 1f94d91
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import frc.robot.commands.mailbox.DeployMailbox;
import frc.robot.commands.mailbox.DeployPneumatics;
import frc.robot.commands.mailbox.FireNoteRoutine;
import frc.robot.commands.mailbox.FireNoteRoutineNoLimitSwitch;
import frc.robot.commands.mailbox.RunBelts;
import frc.robot.subsystems.Drive;
import frc.robot.subsystems.Intake;
Expand Down Expand Up @@ -85,6 +86,8 @@ public class RobotContainer {
private DeployMailbox deployMailbox = new DeployMailbox();
private DeindexNote deindexNote = new DeindexNote();
private FireNoteRoutine fireNote = new FireNoteRoutine();
private FireNoteRoutineNoLimitSwitch fireNoteRoutineNoLimitSwitch =
new FireNoteRoutineNoLimitSwitch();
private RunIntake runIntake = new RunIntake();
private AimWithLimelight aimToAmp =
new AimWithLimelight(
Expand Down Expand Up @@ -134,8 +137,10 @@ private void configureBindings() {
driverController.leftStick().toggleOnTrue(driveFieldOriented);

driverController.x().onTrue(enterXMode);
driverController.a().onTrue(runIntake);
driverController.y().onTrue(fireNote);
driverController.a().onTrue(runIntake);
driverController.rightTrigger().onTrue(deployMailbox);
driverController.b().onTrue(fireNoteRoutineNoLimitSwitch);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

/*
* Asimov's Laws:
* The First Law: A robot may not injure a human being or, through inaction, allow a human being to come to harm.
* The Second Law: A robot must obey the orders given it by human beings except where such orders would conflict with the First Law.
* The Third Law: A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.
*/

package frc.robot.commands.mailbox;

import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import frc.robot.commands.RunIntake;

/**
* Scores the note into the amp. Raises the mailbox, runs the mailbox belts, and then runs the index
* belts to send the note into the belts without a limit switch.
*/
public class FireNoteRoutineNoLimitSwitch extends ParallelCommandGroup {
/** Creates a new FireNoteRoutineNoLimitSwitch. */
public FireNoteRoutineNoLimitSwitch() {
addCommands(new DeployMailbox(), new RunIntake());
}
}

0 comments on commit 1f94d91

Please sign in to comment.