This commit is contained in:
samuel desharnais 2023-11-28 18:40:06 -05:00
parent 426d7e9885
commit 9a6c653c72
2 changed files with 23 additions and 10 deletions

View File

@ -12,10 +12,15 @@ import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.RunCommand; import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.button.CommandJoystick;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import edu.wpi.first.wpilibj2.command.button.JoystickButton; import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import frc.robot.commands.Avancer; import frc.robot.commands.Avancer;
import frc.robot.commands.Force1; import frc.robot.commands.Force1;
import frc.robot.commands.Force2;
import frc.robot.commands.Force3;
import frc.robot.commands.Force4;
import frc.robot.commands.Force5;
import frc.robot.commands.Force6; import frc.robot.commands.Force6;
import frc.robot.commands.Force7; import frc.robot.commands.Force7;
import frc.robot.commands.Reculer; import frc.robot.commands.Reculer;
@ -26,9 +31,15 @@ import frc.robot.subsystems.Lanceur;
public class RobotContainer { public class RobotContainer {
Lanceur lanceur = new Lanceur(); Lanceur lanceur = new Lanceur();
Accumulateur accumulateur = new Accumulateur(); Accumulateur accumulateur = new Accumulateur();
Force7 Force7 = new Force7(lanceur, null, accumulateur);
Force1 Force1 = new Force1(lanceur, accumulateur, null); Force1 Force1 = new Force1(lanceur, accumulateur, null);
Force2 Force2 = new Force2(lanceur, accumulateur, null);
Force3 Force3 = new Force3(lanceur, null, accumulateur);
Force4 Force4 = new Force4(lanceur, null, accumulateur);
Force5 Force5 = new Force5(lanceur, null, accumulateur);
Force6 Force6 = new Force6(lanceur, null, accumulateur);
Force7 Force7 = new Force7(lanceur, null, accumulateur);
ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard"); ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard");
ShuffleboardLayout forces = Shuffleboard.getTab("Dashboard") ShuffleboardLayout forces = Shuffleboard.getTab("Dashboard")
.getLayout("limitswitchsgratte", BuiltInLayouts.kList) .getLayout("limitswitchsgratte", BuiltInLayouts.kList)
@ -41,7 +52,7 @@ public class RobotContainer {
GenericEntry force6 = forces.add("Force6", 0).getEntry(); GenericEntry force6 = forces.add("Force6", 0).getEntry();
GenericEntry force7 = forces.add("Force7", 0).getEntry(); GenericEntry force7 = forces.add("Force7", 0).getEntry();
CommandXboxController manette = new CommandXboxController(0); CommandXboxController manette = new CommandXboxController(0);
Joystick joystick1 = new Joystick(0); CommandJoystick joystick1 = new CommandJoystick(0);
Drive drive = new Drive(); Drive drive = new Drive();
public RobotContainer() { public RobotContainer() {
@ -52,12 +63,14 @@ public class RobotContainer {
} }
private void configureBindings() { private void configureBindings() {
JoystickButton button7 = new JoystickButton(joystick1, 7); joystick1.button(7).onTrue(Force1);
JoystickButton button8 = new JoystickButton(joystick1, 8); joystick1.button(8).onTrue(Force2);
JoystickButton button9 = new JoystickButton(joystick1, 9); joystick1.button(9).onTrue(Force3);
JoystickButton button10 = new JoystickButton(joystick1, 10); joystick1.button(10).onTrue(Force4);
JoystickButton button11 = new JoystickButton(joystick1, 11); joystick1.button(11).onTrue(Force5);
JoystickButton button12 = new JoystickButton(joystick1, 12); joystick1.button(12).onTrue(Force6);
joystick1.button(3).onTrue(Force7);
} }