Compare commits
2 Commits
1e5b837267
...
5f8c222351
Author | SHA1 | Date | |
---|---|---|---|
|
5f8c222351 | ||
|
0e349c53bb |
@ -5,15 +5,20 @@
|
|||||||
package frc.robot.commands.grimpeur;
|
package frc.robot.commands.grimpeur;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
import frc.robot.subsystems.Bougie;
|
||||||
import frc.robot.subsystems.Grimpeur;
|
import frc.robot.subsystems.Grimpeur;
|
||||||
|
|
||||||
/* 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 */
|
/* 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 GrimpeurManuelhaut extends Command {
|
public class GrimpeurManuelhaut extends Command {
|
||||||
private Grimpeur grimpeur;
|
private Grimpeur grimpeur;
|
||||||
|
|
||||||
|
private Bougie bougie;
|
||||||
/** Creates a new GrimpeurManuel. */
|
/** Creates a new GrimpeurManuel. */
|
||||||
public GrimpeurManuelhaut(Grimpeur grimpeur) {
|
public GrimpeurManuelhaut(Grimpeur grimpeur,Bougie bougie) {
|
||||||
this.grimpeur = grimpeur;
|
this.grimpeur = grimpeur;
|
||||||
addRequirements(grimpeur);
|
|
||||||
|
this.bougie = bougie;
|
||||||
|
addRequirements(grimpeur, bougie);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,11 +30,13 @@ public class GrimpeurManuelhaut extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(grimpeur.stop()){
|
if(grimpeur.stop()){
|
||||||
grimpeur.grimpe(0);
|
bougie.RainBow();
|
||||||
|
grimpeur.grimpe(-0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
else{
|
else{
|
||||||
grimpeur.grimpe(0.2);
|
bougie.RainBowStop();
|
||||||
|
grimpeur.grimpe(-0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -38,6 +45,10 @@ public class GrimpeurManuelhaut extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
grimpeur.grimpe(0);
|
grimpeur.grimpe(0);
|
||||||
|
if(grimpeur.stop()){
|
||||||
|
bougie.RainBow();
|
||||||
|
}
|
||||||
|
else{bougie.RainBowStop();}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user