// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. package frc.robot.subsystems; import com.revrobotics.spark.SparkFlex; import com.revrobotics.spark.SparkLowLevel.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; public class Lanceur extends SubsystemBase { ShuffleboardTab teb = Shuffleboard.getTab("teb"); SparkFlex moteur1 = new SparkFlex(2, MotorType.kBrushless); SparkFlex moteur2 = new SparkFlex(3, MotorType.kBrushless); SparkFlex Demeleur = new SparkFlex(4, MotorType.kBrushless); GenericEntry vitesse = teb.add("vitesse lanceur",100).getEntry(); public void Lancer(double vitesse){ moteur1.set(vitesse); moteur2.set(-vitesse); } public void Demeler(double vitesse){ Demeleur.set(vitesse); } public double Vitesse(){ return moteur1.getEncoder().getVelocity(); } public double Amp(){ return moteur1.getOutputCurrent(); } public double vitesseDemander(){ return vitesse.getDouble(100); } /** Creates a new Lanceur. */ public Lanceur() { teb.addDouble("amperage lanceur", this::Amp); } @Override public void periodic() { // This method will be called once per scheduler run } }