This commit is contained in:
EdwardFaucher
2024-11-13 19:13:35 -05:00
4 changed files with 24 additions and 21 deletions

View File

@ -21,7 +21,9 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase;
public class Lanceur extends SubsystemBase {
/** Creates a new Lanceur. */
public Lanceur() {}
public Lanceur() {dashboard.add("rottourel", 0.2)
.withSize(0,0)
.withPosition(1, 3);}
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
final WPI_TalonSRX lanceur1 = new WPI_TalonSRX(0);
@ -32,13 +34,9 @@ public class Lanceur extends SubsystemBase {
private GenericEntry vitesse =
dashboard.add("vitesselanceur", 0.2)
.withSize(0,0)
.withPosition(1, 4)
.getEntry();
private GenericEntry rotation =
dashboard.add("rottourel", 0.2)
.withSize(0,0)
.withPosition(1, 5)
.withPosition(0, 3)
.getEntry();
public void encodeur(double distance){
lanceur1.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
lanceur2.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
@ -58,9 +56,7 @@ public class Lanceur extends SubsystemBase {
public void tourelRotation(double x, double y, double rotation){
tourelle.set(rotation);
}
public void tourelRotation(){
tourelle.set(rotation.getDouble(0.1));
}
public double vitessetourel(){
return(tourelle.getEncoder().getVelocity());
}