acc + update dash
This commit is contained in:
@ -12,8 +12,8 @@ import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
||||
public class Accumulateur extends SubsystemBase {
|
||||
|
||||
/** Creates a new Accumulateur. */
|
||||
public Accumulateur() {dashboard.addBoolean("photocellacc", this::photocell).withSize(1, 1).withPosition(0, 1);
|
||||
dashboard.addBoolean("photocellacc2", this::photocell).withSize(1, 1).withPosition(0, 1);
|
||||
public Accumulateur() {dashboard.addBoolean("photocell", this::photocell).withSize(1, 1).withPosition(0, 1);
|
||||
dashboard.addBoolean("photocell2", this::photocell).withSize(1, 1).withPosition(0, 1);
|
||||
}
|
||||
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
|
||||
|
||||
@ -23,8 +23,8 @@ public class Accumulateur extends SubsystemBase {
|
||||
.withPosition(0, 4)
|
||||
.getEntry();
|
||||
|
||||
final WPI_TalonSRX accumulateur1 = new WPI_TalonSRX(0);
|
||||
final WPI_TalonSRX accumulateur2 = new WPI_TalonSRX(10);
|
||||
final WPI_TalonSRX strap = new WPI_TalonSRX(0);
|
||||
final WPI_TalonSRX roueRouge = new WPI_TalonSRX(10);
|
||||
final DigitalInput photocell = new DigitalInput(20);
|
||||
final DigitalInput photocell2 = new DigitalInput(21);
|
||||
public void encodeur(){
|
||||
@ -32,10 +32,17 @@ public class Accumulateur extends SubsystemBase {
|
||||
public boolean photocell(){
|
||||
return photocell.get();
|
||||
}
|
||||
public void desaccumule(double vitesse){
|
||||
accumulateur1.set(vitesse);
|
||||
accumulateur2.set(-vitesse);
|
||||
public boolean photocell2(){
|
||||
return photocell2.get();
|
||||
}
|
||||
public void desaccumule(double vitesse){
|
||||
strap.set(vitesse);
|
||||
|
||||
}
|
||||
public void Petitlanceur(double vitesse){
|
||||
roueRouge.set(vitesse);
|
||||
}
|
||||
|
||||
public void desaccumule(){
|
||||
desaccumule(vitesse.getDouble(0.9));
|
||||
}
|
||||
|
@ -19,7 +19,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);
|
||||
@ -28,13 +30,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);
|
||||
@ -53,9 +51,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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user