From ac05fe4d5021eaf14244f3422641572c6ade83a3 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Tue, 23 Jan 2024 18:50:07 -0500 Subject: [PATCH] limitswitchsacc --- src/main/java/frc/robot/Constants.java | 1 + src/main/java/frc/robot/subsystem/Accumulateur.java | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index cf31264..ca8a00f 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -46,6 +46,7 @@ public class Constants { public static int guideurhaut = 23; public static int guideurbas = 24; public static int limitacc = 25; + public static int limitacc2 = 76; public static int limithaut = 28; public static int limitbas = 29; diff --git a/src/main/java/frc/robot/subsystem/Accumulateur.java b/src/main/java/frc/robot/subsystem/Accumulateur.java index 622df2e..04b7821 100644 --- a/src/main/java/frc/robot/subsystem/Accumulateur.java +++ b/src/main/java/frc/robot/subsystem/Accumulateur.java @@ -16,10 +16,12 @@ public class Accumulateur extends SubsystemBase { final WPI_TalonSRX Moteuracc2 = new WPI_TalonSRX(Constants.Moteuracc2); final WPI_TalonSRX Moteuracc = new WPI_TalonSRX(Constants.Moteuracc); - final DigitalInput limitacc = new DigitalInput(0); + final DigitalInput limitacc = new DigitalInput(Constants.limitacc); + final DigitalInput limitacc2 = new DigitalInput(Constants.limitacc2); public void Deaccumuler(double vitesse){Moteuracc2.set(vitesse);} public void moteuraccfollow(){Moteuracc.follow(Moteuracc2); Moteuracc.setInverted(true);} - + public boolean limitswitch1(){return limitacc.get();} + public boolean limitswitch2(){return limitacc2.get();} @Override public void periodic() { // This method will be called once per scheduler run