From c564c9770365ea860f3c70c3aa4b846330fa3c58 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Thu, 1 Feb 2024 19:44:44 -0500 Subject: [PATCH] lancer -> lanceur pour les moteurs --- src/main/java/frc/robot/Constants.java | 20 ++++++++-------- .../java/frc/robot/subsystem/Lanceur.java | 24 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 8c918b3..21e30aa 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -43,16 +43,16 @@ public class Constants { public static int ArriereGauche = 7; // Limit switch - public static int guideurhaut = 23; - public static int guideurbas = 24; - public static int limitacc = 25; - public static int limitacc2 = 76; - public static int limithaut = 28; - public static int limitbas = 29; + public static int guideurhaut = 0; + public static int guideurbas = 1; + public static int limitacc = 2; + public static int limitacc2 = 3; + public static int limithaut = 4; + public static int limitbas = 5; //piston - public static int pistondroiteouvre= 30; - public static int pistondroiteferme= 31; - public static int pistondgaucheouvre= 32; - public static int pistondgauchferme= 32; + public static int pistondroiteouvre= 0; + public static int pistondroiteferme= 1; + public static int pistondgaucheouvre= 2; + public static int pistondgauchferme= 3; } diff --git a/src/main/java/frc/robot/subsystem/Lanceur.java b/src/main/java/frc/robot/subsystem/Lanceur.java index ddae36a..f5a58cc 100644 --- a/src/main/java/frc/robot/subsystem/Lanceur.java +++ b/src/main/java/frc/robot/subsystem/Lanceur.java @@ -16,25 +16,25 @@ public class Lanceur extends SubsystemBase { public Lanceur() {} - final CANSparkMax lancer = new CANSparkMax(Constants.lanceur, MotorType.kBrushless); - final CANSparkMax lancer2 = new CANSparkMax(Constants.lancer2, MotorType.kBrushless); - final CANSparkMax lancer3 = new CANSparkMax(Constants.lancer3, MotorType.kBrushless); - final CANSparkMax lancer4 = new CANSparkMax(Constants.lancer4, MotorType.kBrushless); + final CANSparkMax lanceur1 = new CANSparkMax(Constants.lanceur, MotorType.kBrushless); + final CANSparkMax lanceur2 = new CANSparkMax(Constants.lancer2, MotorType.kBrushless); + final CANSparkMax lanceur3 = new CANSparkMax(Constants.lancer3, MotorType.kBrushless); + final CANSparkMax lanceur4 = new CANSparkMax(Constants.lancer4, MotorType.kBrushless); public void pid(){ - lancer.getPIDController(); + lanceur1.getPIDController(); } public void lancer(double vitesse){ - lancer.set(vitesse); + lanceur1.set(vitesse); } public double vitesse(double vitesse){ - return lancer.getEncoder().getVelocity(); + return lanceur1.getEncoder().getVelocity(); } public void lanceur(){ - lancer2.follow(lancer); - lancer3.follow(lancer); - lancer4.follow(lancer); - lancer3.setInverted(true); - lancer4.setInverted(true); + lanceur2.follow(lanceur1); + lanceur3.follow(lanceur1); + lanceur4.follow(lanceur1); + lanceur3.setInverted(true); + lanceur4.setInverted(true); } @Override