This commit is contained in:
Olivier Dubois 2024-10-28 19:17:37 -04:00
commit 1a899887da

View File

@ -22,19 +22,20 @@ public class Lanceur extends SubsystemBase {
final WPI_TalonSRX lanceur1 = new WPI_TalonSRX(0);
final WPI_TalonSRX lanceur2 = new WPI_TalonSRX(1);
final CANSparkMax tourel = new CANSparkMax(2, MotorType.kBrushed);
final CANSparkMax tourelle = new CANSparkMax(2, MotorType.kBrushed);
public void encodeur(double distance){
lanceur1.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
lanceur2.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
lanceur1.setStatusFramePeriod(StatusFrameEnhanced.Status_2_Feedback0, 1);
lanceur2.setStatusFramePeriod(StatusFrameEnhanced.Status_2_Feedback0, 1);
lanceur1.configFactoryDefault();
}
public void lance(double vitesse){
lanceur1.set(vitesse);
lanceur2.set(-vitesse);
}
public void tourelRotation(double vitesse){
tourel.set(vitesse);
tourelle.set(vitesse);
}
public void setPID(double p, double i, int d) {
}