touche, amperage, distance

This commit is contained in:
Antoine PerreaultE
2025-03-03 09:22:48 -05:00
parent 37452f0b05
commit 264bbd003f
17 changed files with 227 additions and 102 deletions

View File

@ -11,10 +11,12 @@ import frc.robot.subsystems.Pince;
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class Depart extends Command {
private Elevateur elevateur;
private Pince pince;
/** Creates a new L2. */
public Depart(Elevateur elevateur, Pince pince) {
this.elevateur = elevateur;
addRequirements(elevateur);
this.pince = pince;
addRequirements(elevateur, pince);
// Use addRequirements() here to declare subsystem dependencies.
}
@ -25,20 +27,27 @@ public class Depart extends Command {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if(pince.position()){
pince.pivote(0);
pince.reset();
}
else{
pince.pivote(-0.2);
}
if(elevateur.limit2()==true){
elevateur.vitesse(0);
elevateur.reset();
}
else{
elevateur.vitesse(.3);
elevateur.vitesse(.5);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
elevateur.vitesse(0);
pince.pivote(0);
}
// Returns true when the command should end.