Debut de Dashboard avec un erreur :(

This commit is contained in:
Olivier Dubois 2023-11-06 19:51:10 -05:00
parent 5eb83bf7e7
commit 6c28e3f373
2 changed files with 20 additions and 5 deletions

View File

@ -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.
}

View File

@ -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);