diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 2e84c89..12bf559 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -47,6 +47,7 @@ public class RobotContainer { Balayer balayer = new Balayer(balayeuse, accumulateur); GuiderHaut guiderHaut = new GuiderHaut(guideur); GuiderBas guiderBas = new GuiderBas(guideur); + Lancer lancer = new Lancer(lanceur); LancerNote lancernote = new LancerNote(lanceur, accumulateur); Lancerampli lancerampli = new Lancerampli(lanceur); CommandJoystick joystick = new CommandJoystick(0); diff --git a/src/main/java/frc/robot/command/Balayer.java b/src/main/java/frc/robot/command/Balayer.java index 61a1dc7..58e3531 100644 --- a/src/main/java/frc/robot/command/Balayer.java +++ b/src/main/java/frc/robot/command/Balayer.java @@ -26,7 +26,7 @@ public class Balayer extends Command { public void execute() { if(accumulateur.limitswitch()){ balayeuse.balaye(0); - accumulateur.Accumuler(0); + accumulateur.Accumuler(); } else{ balayeuse.balaye(0.6); diff --git a/src/main/java/frc/robot/command/Lancer.java b/src/main/java/frc/robot/command/Lancer.java index 20e58e1..de4314e 100644 --- a/src/main/java/frc/robot/command/Lancer.java +++ b/src/main/java/frc/robot/command/Lancer.java @@ -26,7 +26,7 @@ public class Lancer extends Command { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - lanceur.lancer(0.3); + lanceur.lancerspeaker(); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/command/LancerNote.java b/src/main/java/frc/robot/command/LancerNote.java index 76fed0d..d653184 100644 --- a/src/main/java/frc/robot/command/LancerNote.java +++ b/src/main/java/frc/robot/command/LancerNote.java @@ -26,7 +26,7 @@ public class LancerNote extends Command { @Override public void execute() { double vitesse = 100; - lancer.lancer(vitesse); + lancer.lancerspeaker(); if(lancer.vitesse(vitesse)>vitesse){ accumulateur.Accumuler(0.6); } diff --git a/src/main/java/frc/robot/command/Lancerampli.java b/src/main/java/frc/robot/command/Lancerampli.java index 81701e7..450c87a 100644 --- a/src/main/java/frc/robot/command/Lancerampli.java +++ b/src/main/java/frc/robot/command/Lancerampli.java @@ -28,7 +28,7 @@ public class Lancerampli extends Command { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - lanceur.lancer(0.1); + lanceur.lanceramp(); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/subsystem/Lanceur.java b/src/main/java/frc/robot/subsystem/Lanceur.java index f5a58cc..b14978d 100644 --- a/src/main/java/frc/robot/subsystem/Lanceur.java +++ b/src/main/java/frc/robot/subsystem/Lanceur.java @@ -7,15 +7,24 @@ package frc.robot.subsystem; import com.revrobotics.CANSparkMax; 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 frc.robot.Constants; public class Lanceur extends SubsystemBase { /** Creates a new Lanceur. */ - - - public Lanceur() {} + ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard"); + private GenericEntry vitesse = + dashboard.add("vitesse", 1) + .getEntry(); + private GenericEntry vitesseamp = + dashboard.add("vitesseamp", 1) + .getEntry(); + public Lanceur() { + + } 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); @@ -26,6 +35,12 @@ public class Lanceur extends SubsystemBase { public void lancer(double vitesse){ lanceur1.set(vitesse); } + public void lancerspeaker(){ + lancer(vitesse.getDouble(0.1)); + } + public void lanceramp(){ + lancer(vitesseamp.getDouble(0.5)); + } public double vitesse(double vitesse){ return lanceur1.getEncoder().getVelocity(); }