Merge branch 'main' of https://git.demerso.net/pls5618/2024/robot
This commit is contained in:
		| @@ -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; | ||||
| } | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user