Compare commits
No commits in common. "8d93e7f24ff0017c122b1f3f8324f54f5d2ec1da" and "f1406f0db044d260162b58ff0907a0379b3e8c8c" have entirely different histories.
8d93e7f24f
...
f1406f0db0
@ -12,24 +12,17 @@ import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
|||||||
import com.revrobotics.CANSparkMax;
|
import com.revrobotics.CANSparkMax;
|
||||||
import com.revrobotics.CANSparkLowLevel.MotorType;
|
import com.revrobotics.CANSparkLowLevel.MotorType;
|
||||||
|
|
||||||
import edu.wpi.first.networktables.GenericEntry;
|
|
||||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
|
||||||
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
|
||||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||||
|
|
||||||
public class Lanceur extends SubsystemBase {
|
public class Lanceur extends SubsystemBase {
|
||||||
/** Creates a new Lanceur. */
|
/** Creates a new Lanceur. */
|
||||||
public Lanceur() {}
|
public Lanceur() {}
|
||||||
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
|
|
||||||
|
|
||||||
final WPI_TalonSRX lanceur1 = new WPI_TalonSRX(0);
|
final WPI_TalonSRX lanceur1 = new WPI_TalonSRX(0);
|
||||||
final WPI_TalonSRX lanceur2 = new WPI_TalonSRX(1);
|
final WPI_TalonSRX lanceur2 = new WPI_TalonSRX(1);
|
||||||
final CANSparkMax tourelle = new CANSparkMax(2, MotorType.kBrushed);
|
final CANSparkMax tourelle = new CANSparkMax(2, MotorType.kBrushed);
|
||||||
private GenericEntry vitesse =
|
|
||||||
dashboard.add("vitesselanceur", 0.2)
|
|
||||||
.withSize(0,0)
|
|
||||||
.withPosition(1, 4)
|
|
||||||
.getEntry();
|
|
||||||
public void encodeur(double distance){
|
public void encodeur(double distance){
|
||||||
lanceur1.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
|
lanceur1.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
|
||||||
lanceur2.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
|
lanceur2.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
|
||||||
@ -43,9 +36,6 @@ public class Lanceur extends SubsystemBase {
|
|||||||
public void lance(double vitesse){
|
public void lance(double vitesse){
|
||||||
lanceur1.set(vitesse);
|
lanceur1.set(vitesse);
|
||||||
}
|
}
|
||||||
public void lance(){
|
|
||||||
lance(vitesse.getDouble(0.2));
|
|
||||||
}
|
|
||||||
public void tourelRotation(double x, double y, double rotation){
|
public void tourelRotation(double x, double y, double rotation){
|
||||||
tourelle.set(rotation);
|
tourelle.set(rotation);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user