bougie rainbw
This commit is contained in:
parent
17875a3d15
commit
0e349c53bb
@ -7,17 +7,20 @@ package frc.robot.commands.grimpeur;
|
|||||||
import java.util.function.DoubleSupplier;
|
import java.util.function.DoubleSupplier;
|
||||||
|
|
||||||
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 GrimpeurManuel extends Command {
|
public class GrimpeurManuel extends Command {
|
||||||
private Grimpeur grimpeur;
|
private Grimpeur grimpeur;
|
||||||
private DoubleSupplier x;
|
private DoubleSupplier x;
|
||||||
|
private Bougie bougie;
|
||||||
/** Creates a new GrimpeurManuel. */
|
/** Creates a new GrimpeurManuel. */
|
||||||
public GrimpeurManuel(Grimpeur grimpeur,DoubleSupplier x) {
|
public GrimpeurManuel(Grimpeur grimpeur,DoubleSupplier x, Bougie bougie) {
|
||||||
this.grimpeur = grimpeur;
|
this.grimpeur = grimpeur;
|
||||||
this.x = x;
|
this.x = x;
|
||||||
addRequirements(grimpeur);
|
this.bougie = bougie;
|
||||||
|
addRequirements(grimpeur, bougie);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,9 +32,11 @@ public class GrimpeurManuel extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(grimpeur.stop()){
|
if(grimpeur.stop()){
|
||||||
|
bougie.RainBow();
|
||||||
grimpeur.grimpe(0);
|
grimpeur.grimpe(0);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
bougie.RainBowStop();
|
||||||
grimpeur.grimpe(x.getAsDouble());
|
grimpeur.grimpe(x.getAsDouble());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,6 +46,10 @@ public class GrimpeurManuel 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