From a023213a183e21196fa882742ba618961656cc52 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Wed, 13 Nov 2024 19:24:14 -0500 Subject: [PATCH] limitswitch --- src/main/java/frc/robot/Commands/FollowAprilTag.java | 3 +++ src/main/java/frc/robot/Commands/Lancer.java | 2 ++ src/main/java/frc/robot/RobotContainer.java | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/Commands/FollowAprilTag.java b/src/main/java/frc/robot/Commands/FollowAprilTag.java index 0f4a1ef..22a27e8 100644 --- a/src/main/java/frc/robot/Commands/FollowAprilTag.java +++ b/src/main/java/frc/robot/Commands/FollowAprilTag.java @@ -27,10 +27,13 @@ public class FollowAprilTag extends Command { @Override public void execute() { + if (enlignement.getv()==1) { lanceur.tourelRotation(0,0, enlignement.getx()/30); } + if (lanceur.limitswitch1() || lanceur.limitswitch2()){ + lanceur.lance(0);} else { lanceur.tourelRotation(0, 0, 0); diff --git a/src/main/java/frc/robot/Commands/Lancer.java b/src/main/java/frc/robot/Commands/Lancer.java index e26ed07..f0aee4f 100644 --- a/src/main/java/frc/robot/Commands/Lancer.java +++ b/src/main/java/frc/robot/Commands/Lancer.java @@ -27,7 +27,9 @@ public class Lancer extends Command { @Override public void execute() { lanceur.lance(); + accumulateur.Petitlanceur(0.7); accumulateur.desaccumule(0.2); + } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 56f1d9b..20a4557 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -41,7 +41,7 @@ public class RobotContainer { private void configureBindings() { - manette.x().whileTrue(new Lancer(lanceur)); + manette.x().whileTrue(new Lancer(lanceur,accumulateur)); manette.leftBumper().toggleOnTrue(new FollowAprilTag(limelight3G, lanceur)); manette.a().whileTrue(new Desaccumuler(accumulateur)); }