elevateurise mieux

This commit is contained in:
Antoine PerreaultE 2025-01-28 18:54:42 -05:00
parent e7b4b47928
commit 0fdfa4269d
3 changed files with 15 additions and 5 deletions

View File

@ -24,12 +24,16 @@ public class L2 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() {
if(elevateur.position()>=500){ if(elevateur.position()>=500 && elevateur.position()<=510){
elevateur.vitesse(0); elevateur.vitesse(0);
} }
else if(elevateur.position()>=510){
elevateur.vitesse(-0.3);
}
else{ else{
elevateur.vitesse(.3); elevateur.vitesse(.3);
} }
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.
@ -41,6 +45,6 @@ public class L2 extends Command {
// Returns true when the command should end. // Returns true when the command should end.
@Override @Override
public boolean isFinished() { public boolean isFinished() {
return elevateur.position()>=500; return false;
} }
} }

View File

@ -24,9 +24,12 @@ public class L3 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() {
if(elevateur.position()>=700){ if(elevateur.position()>=700 && elevateur.position()<=710){
elevateur.vitesse(0); elevateur.vitesse(0);
} }
else if(elevateur.position()>=510){
elevateur.vitesse(-0.5);
}
else{ else{
elevateur.vitesse(.5); elevateur.vitesse(.5);
} }
@ -41,6 +44,6 @@ public class L3 extends Command {
// Returns true when the command should end. // Returns true when the command should end.
@Override @Override
public boolean isFinished() { public boolean isFinished() {
return elevateur.position()>=700; return false;
} }
} }

View File

@ -24,9 +24,12 @@ public class L4 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() {
if(elevateur.position()>=800){ if(elevateur.position()>=800 && elevateur.position()<=810){
elevateur.vitesse(0); elevateur.vitesse(0);
} }
else if(elevateur.position()>=810){
elevateur.vitesse(-0.5);
}
else{ else{
elevateur.vitesse(.5); elevateur.vitesse(.5);
} }