diff --git a/bin/main/frc/robot/subsystems/BasePilotable.class b/bin/main/frc/robot/subsystems/BasePilotable.class index 62da180..96315e4 100644 Binary files a/bin/main/frc/robot/subsystems/BasePilotable.class and b/bin/main/frc/robot/subsystems/BasePilotable.class differ diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 312ba79..b5bfcb2 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -10,6 +10,7 @@ import com.revrobotics.CANSparkMaxLowLevel.MotorType; import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.PneumaticsModuleType; +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.drive.DifferentialDrive; import edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup; import edu.wpi.first.wpilibj2.command.SubsystemBase; @@ -24,7 +25,8 @@ public class BasePilotable extends SubsystemBase { final MotorControllerGroup gauche = new MotorControllerGroup(avantgauche, arrieregauche); final DifferentialDrive drive = new DifferentialDrive(gauche, droit); private AHRS gyroscope = new AHRS();public double getangle() {return gyroscope.getAngle();} - + private DoubleSolenoid brakedroit = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakedroit, Constants.brakedroit); + private DoubleSolenoid brakegauche = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakegauche, Constants.brakegauche); public double getpitch() { return gyroscope.getPitch(); } @@ -44,7 +46,14 @@ public class BasePilotable extends SubsystemBase { arrieredroit.getEncoder().setPosition(0); arrieregauche.getEncoder().setPosition(0); } - +public void BrakeOuvre(){ + brakedroit.set(Value.kForward); + brakegauche.set(Value.kForward); +} +public void BrakeFerme(){ + brakedroit.set(Value.kReverse); + brakegauche.set(Value.kReverse); +} /** Creates a new BasePilotable. */ public BasePilotable() { droit.setInverted(true);