Module fini

This commit is contained in:
Samuel
2026-02-02 20:25:50 -05:00
parent ecf2365eaf
commit 50a686a5d6
15 changed files with 1261 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.subsystems;
import com.revrobotics.spark.SparkFlex;
import com.revrobotics.spark.SparkLowLevel.MotorType;
import com.revrobotics.spark.config.SparkMaxConfig;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Lanceur extends SubsystemBase {
SparkFlex moteur1 = new SparkFlex(2, MotorType.kBrushless);
SparkFlex moteur2 = new SparkFlex(3, MotorType.kBrushless);
SparkFlex Demeleur = new SparkFlex(4, MotorType.kBrushless);
SparkMaxConfig slaveConfig = new SparkMaxConfig();
public void Lancer(double vitesse){
moteur1.set(vitesse);
slaveConfig.follow(moteur1, true);
moteur2.configure(slaveConfig,null,null);
}
public void Demeler(double vitesse){
Demeleur.set(vitesse);
}
public double Vitesse(){
return moteur1.getEncoder().getVelocity();
}
/** Creates a new Lanceur. */
public Lanceur() {
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}