From a6f0d7d09447932d907c3ff818ee2b3228d00a0b Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 23 Nov 2022 19:14:20 -0500 Subject: [PATCH] adsf --- src/main/java/frc/robot/RobotContainer.java | 7 ++++--- src/main/java/frc/robot/commands/BoutonA.java | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 4c56519..155eaca 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -19,6 +19,7 @@ import frc.robot.subsystems.Pistonshaker; // commands import frc.robot.commands.Activer_poussoir; import frc.robot.commands.ActiverBlockeur; +import frc.robot.commands.Activer_poussoir; import frc.robot.commands.Activershaker; import frc.robot.commands.DesactiverBlockeur; @@ -66,13 +67,13 @@ public class RobotContainer { JoystickButton buttonA = new JoystickButton(manette, XboxController.Button.kA.value); buttonA.whileHeld(Activer_poussoir); JoystickButton rightbumper = new JoystickButton(manette, XboxController.Button.kLeftBumper.value); - rightbumper.whileHeld(Pistonshaker); + rightbumper.whileHeld(Activershaker); JoystickButton buttonY = new JoystickButton(manette, XboxController.Button.kY.value); - buttonY.whenPressed(DesactiverBlockeur, ActiverBlockeur); + buttonY.whenPressed(DesactiverBlockeur); } - /** + /** * Use this to pass the autonomous command to the main {@link Robot} class. * * @return the command to run in autonomous diff --git a/src/main/java/frc/robot/commands/BoutonA.java b/src/main/java/frc/robot/commands/BoutonA.java index deb50c4..347895d 100644 --- a/src/main/java/frc/robot/commands/BoutonA.java +++ b/src/main/java/frc/robot/commands/BoutonA.java @@ -9,15 +9,22 @@ import frc.robot.subsystems.Poussoir; import frc.robot.subsystems.Pistonshaker; public class BoutonA extends CommandBase { + private Poussoir poussoir; + private Pistonshaker pistonshaker; /** Creates a new boutonA. */ - public BoutonA() { - + public BoutonA(Poussoir poussoir, Pistonshaker pistonshaker) { + this.poussoir = poussoir; + this.pistonshaker = pistonshaker; + addRequirements(poussoir, pistonshaker); // Use addRequirements() here to declare subsystem dependencies. } // Called when the command is initially scheduled. @Override - public void initialize() {} + public void initialize() { + poussoir.pousser(); + pistonshaker.rentrerpiston(); + } // Called every time the scheduler runs while the command is scheduled. @Override @@ -25,9 +32,11 @@ public class BoutonA extends CommandBase { // Called once the command ends or is interrupted. @Override - public void end(boolean interrupted) {} + public void end(boolean interrupted) { + poussoir.tirer(); + pistonshaker.sortirpiston(); - // Returns true when the command should end. + } @Override public boolean isFinished() { return false;