This commit is contained in:
samuel desharnais 2024-02-01 20:01:32 -05:00
commit 353ea19d71
2 changed files with 22 additions and 22 deletions

View File

@ -43,16 +43,16 @@ public class Constants {
public static int ArriereGauche = 7; public static int ArriereGauche = 7;
// Limit switch // Limit switch
public static int guideurhaut = 23; public static int guideurhaut = 0;
public static int guideurbas = 24; public static int guideurbas = 1;
public static int limitacc = 25; public static int limitacc = 2;
public static int limitacc2 = 76; public static int limitacc2 = 3;
public static int limithaut = 28; public static int limithaut = 4;
public static int limitbas = 29; public static int limitbas = 5;
//piston //piston
public static int pistondroiteouvre= 30; public static int pistondroiteouvre= 0;
public static int pistondroiteferme= 31; public static int pistondroiteferme= 1;
public static int pistondgaucheouvre= 32; public static int pistondgaucheouvre= 2;
public static int pistondgauchferme= 32; public static int pistondgauchferme= 3;
} }

View File

@ -16,25 +16,25 @@ public class Lanceur extends SubsystemBase {
public Lanceur() {} public Lanceur() {}
final CANSparkMax lancer = new CANSparkMax(Constants.lanceur, MotorType.kBrushless); final CANSparkMax lanceur1 = new CANSparkMax(Constants.lanceur, MotorType.kBrushless);
final CANSparkMax lancer2 = new CANSparkMax(Constants.lancer2, MotorType.kBrushless); final CANSparkMax lanceur2 = new CANSparkMax(Constants.lancer2, MotorType.kBrushless);
final CANSparkMax lancer3 = new CANSparkMax(Constants.lancer3, MotorType.kBrushless); final CANSparkMax lanceur3 = new CANSparkMax(Constants.lancer3, MotorType.kBrushless);
final CANSparkMax lancer4 = new CANSparkMax(Constants.lancer4, MotorType.kBrushless); final CANSparkMax lanceur4 = new CANSparkMax(Constants.lancer4, MotorType.kBrushless);
public void pid(){ public void pid(){
lancer.getPIDController(); lanceur1.getPIDController();
} }
public void lancer(double vitesse){ public void lancer(double vitesse){
lancer.set(vitesse); lanceur1.set(vitesse);
} }
public double vitesse(double vitesse){ public double vitesse(double vitesse){
return lancer.getEncoder().getVelocity(); return lanceur1.getEncoder().getVelocity();
} }
public void lanceur(){ public void lanceur(){
lancer2.follow(lancer); lanceur2.follow(lanceur1);
lancer3.follow(lancer); lanceur3.follow(lanceur1);
lancer4.follow(lancer); lanceur4.follow(lanceur1);
lancer3.setInverted(true); lanceur3.setInverted(true);
lancer4.setInverted(true); lanceur4.setInverted(true);
} }
@Override @Override