Merge branch 'main' of https://demerso.net/pls5618/2023/robot
This commit is contained in:
commit
42252e0df9
@ -5,9 +5,26 @@ public class Constants {
|
||||
public static int avantgauche = 1;
|
||||
public static int arrieredroit = 2;
|
||||
public static int arrieregauche = 3;
|
||||
public static int leverGratte = 0;
|
||||
public static int baisserGratte = 1;
|
||||
public static int BrasTelescopique = 5;
|
||||
// pneumatique
|
||||
public static int pistonpinceouvre = 0;
|
||||
public static int pistonpinceferme = 1;
|
||||
public static int BrasTelescopique = 5;
|
||||
public static int actuateur = 4;
|
||||
// DIO
|
||||
public static int limitbd = 0;
|
||||
public static int limitbg = 2;
|
||||
public static int limithd = 3;
|
||||
public static int limithg = 1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,40 @@ public class Gratte extends SubsystemBase {
|
||||
/** Creates a new Gratte. */
|
||||
public Gratte() {}
|
||||
|
||||
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
||||
import com.fasterxml.jackson.annotation.JacksonInject.Value;
|
||||
|
||||
import edu.wpi.first.wpilibj.DigitalInput;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import frc.robot.Constants;
|
||||
|
||||
public class Gratte extends SubsystemBase {
|
||||
private WPI_TalonSRX baisserGratte = new WPI_TalonSRX(Constants.leverGratte);
|
||||
private WPI_TalonSRX leverGratte = new WPI_TalonSRX(Constants.baisserGratte);
|
||||
private DigitalInput limithd = new DigitalInput(Constants.limithd);
|
||||
private DigitalInput limithg = new DigitalInput(Constants.limithg);
|
||||
private DigitalInput limitbd = new DigitalInput(Constants.limitbd);
|
||||
private DigitalInput limitbg = new DigitalInput(Constants.limitbg);
|
||||
public boolean hautd(){
|
||||
return limithd.get();
|
||||
}
|
||||
|
||||
public boolean hautg(){
|
||||
return limithg.get();
|
||||
}
|
||||
|
||||
public boolean basd(){
|
||||
return limitbd.get();
|
||||
}
|
||||
public boolean basg(){
|
||||
return limitbg.get();
|
||||
}
|
||||
/** Creates a new Gratte. */
|
||||
public Gratte() {}
|
||||
public void BaisserLever(double vitesse){
|
||||
baisserGratte.set(vitesse);
|
||||
leverGratte.set(vitesse);
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
|
@ -14,15 +14,12 @@ public class Pince extends SubsystemBase {
|
||||
private DoubleSolenoid pistonPince = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonpinceouvre, Constants.pistonpinceferme);
|
||||
/** Creates a new Pince. */
|
||||
public Pince() {
|
||||
|
||||
}
|
||||
public void fermer() {
|
||||
pistonPince.set(Value.kReverse);
|
||||
|
||||
}
|
||||
public void ouvrir() {
|
||||
pistonPince.set(Value.kForward);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user