avancement du dashboard
This commit is contained in:
parent
b4496c8987
commit
f5e879878a
@ -47,6 +47,7 @@ public class RobotContainer {
|
|||||||
Balayer balayer = new Balayer(balayeuse, accumulateur);
|
Balayer balayer = new Balayer(balayeuse, accumulateur);
|
||||||
GuiderHaut guiderHaut = new GuiderHaut(guideur);
|
GuiderHaut guiderHaut = new GuiderHaut(guideur);
|
||||||
GuiderBas guiderBas = new GuiderBas(guideur);
|
GuiderBas guiderBas = new GuiderBas(guideur);
|
||||||
|
Lancer lancer = new Lancer(lanceur);
|
||||||
LancerNote lancernote = new LancerNote(lanceur, accumulateur);
|
LancerNote lancernote = new LancerNote(lanceur, accumulateur);
|
||||||
Lancerampli lancerampli = new Lancerampli(lanceur);
|
Lancerampli lancerampli = new Lancerampli(lanceur);
|
||||||
CommandJoystick joystick = new CommandJoystick(0);
|
CommandJoystick joystick = new CommandJoystick(0);
|
||||||
|
@ -26,7 +26,7 @@ public class Balayer extends Command {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
if(accumulateur.limitswitch()){
|
if(accumulateur.limitswitch()){
|
||||||
balayeuse.balaye(0);
|
balayeuse.balaye(0);
|
||||||
accumulateur.Accumuler(0);
|
accumulateur.Accumuler();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
balayeuse.balaye(0.6);
|
balayeuse.balaye(0.6);
|
||||||
|
@ -26,7 +26,7 @@ public class Lancer extends Command {
|
|||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
lanceur.lancer(0.3);
|
lanceur.lancerspeaker();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
|
@ -26,7 +26,7 @@ public class LancerNote extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
double vitesse = 100;
|
double vitesse = 100;
|
||||||
lancer.lancer(vitesse);
|
lancer.lancerspeaker();
|
||||||
if(lancer.vitesse(vitesse)>vitesse){
|
if(lancer.vitesse(vitesse)>vitesse){
|
||||||
accumulateur.Accumuler(0.6);
|
accumulateur.Accumuler(0.6);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class Lancerampli extends Command {
|
|||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
lanceur.lancer(0.1);
|
lanceur.lanceramp();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
|
@ -7,15 +7,24 @@ package frc.robot.subsystem;
|
|||||||
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;
|
||||||
import frc.robot.Constants;
|
import frc.robot.Constants;
|
||||||
|
|
||||||
public class Lanceur extends SubsystemBase {
|
public class Lanceur extends SubsystemBase {
|
||||||
/** Creates a new Lanceur. */
|
/** Creates a new Lanceur. */
|
||||||
|
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
|
||||||
|
private GenericEntry vitesse =
|
||||||
|
dashboard.add("vitesse", 1)
|
||||||
|
.getEntry();
|
||||||
|
private GenericEntry vitesseamp =
|
||||||
|
dashboard.add("vitesseamp", 1)
|
||||||
|
.getEntry();
|
||||||
|
public Lanceur() {
|
||||||
|
|
||||||
|
}
|
||||||
public Lanceur() {}
|
|
||||||
final CANSparkMax lanceur1 = new CANSparkMax(Constants.lanceur, MotorType.kBrushless);
|
final CANSparkMax lanceur1 = new CANSparkMax(Constants.lanceur, MotorType.kBrushless);
|
||||||
final CANSparkMax lanceur2 = new CANSparkMax(Constants.lancer2, MotorType.kBrushless);
|
final CANSparkMax lanceur2 = new CANSparkMax(Constants.lancer2, MotorType.kBrushless);
|
||||||
final CANSparkMax lanceur3 = new CANSparkMax(Constants.lancer3, 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){
|
public void lancer(double vitesse){
|
||||||
lanceur1.set(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){
|
public double vitesse(double vitesse){
|
||||||
return lanceur1.getEncoder().getVelocity();
|
return lanceur1.getEncoder().getVelocity();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user