Skip to content

Commit

Permalink
buttons started (constants)
Browse files Browse the repository at this point in the history
  • Loading branch information
CXLYSG committed Jan 27, 2024
1 parent cfc8683 commit 8953400
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
22 changes: 19 additions & 3 deletions Robot2024/src/main/java/com/team2813/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,28 @@
*/
public final class Constants {
public static class OperatorConstants {
public static final int operatorControllerPort = 0;
public static final int operatorControllerPort = 1;
public static final CommandPS4Controller operatorController = new CommandPS4Controller(operatorControllerPort);

//operator controls
public static final Trigger intakeButton = operatorController.R1();
public static final Trigger outtakeButton = operatorController.L1();
public static final Trigger shootButton = operatorController.square();
public static final Trigger spoolAutoAimButton = operatorController.triangle();
public static final Trigger spoolPodiumButton = operatorController.circle();
public static final Trigger spoolAmpButton = operatorController.cross();
public static final Trigger climbButton = operatorController.share();
public static final Trigger climbManualUpButton = operatorController.povUp();
public static final Trigger climbManualDownButton = operatorController.povDown();

}
public static class DriverConstants {
public static final int driverControllerPort = 0;
public static final CommandPS4Controller DRIVER_CONTROLLER = new CommandPS4Controller(driverControllerPort);
public static final Trigger SLOWMODE_BUTTON = DRIVER_CONTROLLER.L1();
public static final CommandPS4Controller driverController = new CommandPS4Controller(driverControllerPort);

//driver controls
public static final Trigger slowmodeButton = driverController.L1();
public static final Trigger resetSwerve = driverController.PS();
}

// front right swerve module
Expand Down
9 changes: 7 additions & 2 deletions Robot2024/src/main/java/com/team2813/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@
import static com.team2813.Constants.DriverConstants.*;

public class RobotContainer {
//robot subsystems and commands...

private final SendableChooser<Command> autoChooser;
private final Drive drive = new Drive();


//container for robot (subsystems, OI devices, commands)
private final XboxController driverController = new XboxController(driverControllerPort);
public RobotContainer() {
drive.setDefaultCommand(new DefaultDriveCommand(
Expand All @@ -39,8 +44,8 @@ public Drive getDrive() {
}

private void configureBindings() {
SLOWMODE_BUTTON.onTrue(new InstantCommand(() -> drive.enableSlowMode(true), drive));
SLOWMODE_BUTTON.onFalse(new InstantCommand(() -> drive.enableSlowMode(false), drive));
slowmodeButton.onTrue(new InstantCommand(() -> drive.enableSlowMode(true), drive));
slowmodeButton.onFalse(new InstantCommand(() -> drive.enableSlowMode(false), drive));
}

public Command getAutonomousCommand() {
Expand Down

0 comments on commit 8953400

Please sign in to comment.