Subsystem Pince (Message Consructif)

This commit is contained in:
Olivier Dubois 2023-02-08 19:04:28 -05:00
parent bec4593e9d
commit 7082379eec
2 changed files with 20 additions and 2 deletions

View File

@ -5,6 +5,10 @@ public class Constants {
public static int avantgauche = 1; public static int avantgauche = 1;
public static int arrieredroit = 2; public static int arrieredroit = 2;
public static int arrieregauche = 3; public static int arrieregauche = 3;
// pneumatique
public static int pistonpinceouvre = 0;
public static int pistonpinceferme = 1;

View File

@ -4,14 +4,28 @@
package frc.robot.subsystems.bras; package frc.robot.subsystems.bras;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import frc.robot.Constants;
public class Pince extends SubsystemBase { public class Pince extends SubsystemBase {
private DoubleSolenoid pistonPince = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonpinceouvre, Constants.pistonpinceferme);
/** Creates a new Pince. */ /** Creates a new Pince. */
public Pince() {} public Pince() {
}
public void fermer() {
pistonPince.set(Value.kReverse);
}
public void ouvrir() {
pistonPince.set(Value.kForward);
}
@Override @Override
public void periodic() { public void periodic() {
// This method will be called once per scheduler run
} }
} }