This commit is contained in:
samuel desharnais 2023-12-02 09:48:05 -05:00
parent 61a0cb9610
commit be7fcc7961
2 changed files with 41 additions and 1 deletions

View File

@ -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);
}

View File

@ -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;
}
}