From f86be6301cf30216b63fb64bd17ec720afbc27fc Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Mon, 12 Feb 2024 18:11:55 -0500 Subject: [PATCH] s --- .../java/frc/robot/subsystem/Grimpeur.java | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/main/java/frc/robot/subsystem/Grimpeur.java b/src/main/java/frc/robot/subsystem/Grimpeur.java index 293bdec..c93b430 100644 --- a/src/main/java/frc/robot/subsystem/Grimpeur.java +++ b/src/main/java/frc/robot/subsystem/Grimpeur.java @@ -10,14 +10,12 @@ import com.revrobotics.CANSparkLowLevel.MotorType; import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj.DigitalInput; -import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj.Solenoid; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; -import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; @@ -33,14 +31,11 @@ public class Grimpeur extends SubsystemBase { final CANSparkMax grimpeurd = new CANSparkMax(Constants.grimpeurd,MotorType.kBrushless); final CANSparkMax grimpeurg = new CANSparkMax(Constants.grimpeurg,MotorType.kBrushless); // limit switch - final DigitalInput limitdroite = new DigitalInput(Constants.limithaut); - final DigitalInput limitgauche = new DigitalInput(Constants.limitbas); final Solenoid pistondroite= new Solenoid(PneumaticsModuleType.CTREPCM, Constants.pistondroiteouvre); final Solenoid pistondgauche = new Solenoid(PneumaticsModuleType.CTREPCM, Constants.pistondgaucheouvre); //fonction public Grimpeur() { - layout.addBoolean("limitgrimpeurd", limitdroite::get); - layout.addBoolean("limitgrimpeurg", limitdroite::get); + layout.add("grimpeurencodeurd", encoderd()); layout.add("grimpeurencodeurg", encoderg()); layout.add("pitchgyrogrimpeur", getpitch()); @@ -51,12 +46,6 @@ public void droit(double vitesse){ public void gauche(double vitesse){ grimpeurg.set(vitesse); } -public boolean droite(){ - return limitdroite.get(); -} -public boolean gauche(){ - return limitgauche.get(); -} public void resetencodeurd(){ grimpeurd.getEncoder().setPosition(0); } @@ -84,14 +73,5 @@ public AHRS gyroscope = new AHRS(); public boolean piston(){ return pistondgauche.get(); } - @Override - public void periodic() { - // This method will be called once per scheduler run - if(droite()) { - resetencodeurd(); - } - if(gauche()) { - resetencodeurg(); - } - } } +