diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 0ee7bdb..1ea9ed1 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -23,6 +23,7 @@ import frc.robot.commands.Force5; import frc.robot.commands.Force6; import frc.robot.commands.Force7; import frc.robot.commands.Reculer; +import frc.robot.commands.accumulateurtest; import frc.robot.subsystems.Accumulateur; import frc.robot.subsystems.Drive; import frc.robot.subsystems.Lanceur; @@ -64,6 +65,7 @@ public class RobotContainer { Force5 Force5 = new Force5(lanceur, null, accumulateur); Force6 Force6 = new Force6(lanceur, null, accumulateur); Force7 Force7 = new Force7(lanceur, null, accumulateur); + accumulateurtest accumulateurtest = new accumulateurtest(accumulateur); joystick1.button(7).onTrue(Force1); joystick1.button(8).onTrue(Force2); joystick1.button(9).onTrue(Force3); @@ -71,7 +73,7 @@ public class RobotContainer { joystick1.button(11).onTrue(Force5); joystick1.button(12).onTrue(Force6); joystick1.button(3).onTrue(Force7); - + joystick1.button(5).toggleOnTrue(accumulateurtest); } diff --git a/src/main/java/frc/robot/commands/accumulateurtest.java b/src/main/java/frc/robot/commands/accumulateurtest.java new file mode 100644 index 0000000..d72de01 --- /dev/null +++ b/src/main/java/frc/robot/commands/accumulateurtest.java @@ -0,0 +1,38 @@ +// 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. + +package frc.robot.commands; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc.robot.subsystems.Accumulateur; + +public class accumulateurtest extends CommandBase { + private Accumulateur accumulateur; + /** Creates a new accumulateurtest. */ + public accumulateurtest(Accumulateur accumulateur) { + this.accumulateur = accumulateur; + addRequirements(accumulateur); + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() {} + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + accumulateur.reaccumuler(); + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +}