diff --git a/src/main/java/frc/robot/commands/Force1.java b/src/main/java/frc/robot/commands/Force1.java index 6878de5..3e86349 100644 --- a/src/main/java/frc/robot/commands/Force1.java +++ b/src/main/java/frc/robot/commands/Force1.java @@ -4,16 +4,19 @@ package frc.robot.commands; +import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Lanceur; public class Force1 extends CommandBase { private Lanceur lanceur; - + ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard"); /** Creates a new Force1. */ public Force1(Lancer lancer) { this.lanceur = lanceur; addRequirements(lanceur); + dashboard.addDouble("Force1",this::lanceur); // Use addRequirements() here to declare subsystem dependencies. } diff --git a/src/main/java/frc/robot/subsystems/Lanceur.java b/src/main/java/frc/robot/subsystems/Lanceur.java index d8d4344..8e5be7e 100644 --- a/src/main/java/frc/robot/subsystems/Lanceur.java +++ b/src/main/java/frc/robot/subsystems/Lanceur.java @@ -6,14 +6,26 @@ package frc.robot.subsystems; import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMaxLowLevel.MotorType; + +import edu.wpi.first.networktables.GenericEntry; +import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; +import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; +import frc.robot.commands.Force1; +import frc.robot.commands.Lancer; public class Lanceur extends SubsystemBase { - - final CANSparkMax lanceur = new CANSparkMax(Constants.lanceur, MotorType.kBrushless); - - public Lanceur() {} + ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard"); + ShuffleboardLayout forces = Shuffleboard.getTab("Dashboard") + .getLayout("limitswitchsgratte", BuiltInLayouts.kList) + .withSize(2, 7); + final CANSparkMax lanceur = new CANSparkMax(Constants.lanceur, MotorType.kBrushless); + public Lanceur() { + GenericEntry force1 = forces.addDouble("Force1", Force1.lanceur).GetEntry(); + } public void lancer(double vitesse){ lanceur.set(vitesse);