Limelight
This commit is contained in:
		| @@ -9,14 +9,17 @@ package frc.robot.command; | ||||
| import edu.wpi.first.wpilibj2.command.Command; | ||||
|  | ||||
| import frc.robot.subsystem.Lanceur; | ||||
| import frc.robot.subsystem.Limelight; | ||||
|  | ||||
| public class Lancer extends Command { | ||||
|   /** Creates a new Lanceur. */ | ||||
|   private Limelight limelight; | ||||
|   private Lanceur lanceur; | ||||
|   public Lancer(Lanceur lanceur) { | ||||
|   public Lancer(Lanceur lanceur,Limelight limelight) { | ||||
|     this.limelight = limelight; | ||||
|     this.lanceur = lanceur; | ||||
|     // Use addRequirements() here to declare subsystem dependencies. | ||||
|     addRequirements(lanceur); | ||||
|     addRequirements(lanceur,limelight); | ||||
|   } | ||||
|  | ||||
|   // Called when the command is initially scheduled. | ||||
| @@ -26,7 +29,9 @@ public class Lancer extends Command { | ||||
|   // Called every time the scheduler runs while the command is scheduled. | ||||
|   @Override | ||||
|   public void execute() { | ||||
|     if(limelight.getv()){ | ||||
|     lanceur.lancerspeaker(); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   // Called once the command ends or is interrupted. | ||||
|   | ||||
| @@ -9,15 +9,16 @@ package frc.robot.command; | ||||
| import edu.wpi.first.wpilibj2.command.Command; | ||||
|  | ||||
| import frc.robot.subsystem.Lanceur; | ||||
| import frc.robot.subsystem.Limelight; | ||||
|  | ||||
| public class Lancerampli extends Command { | ||||
|   /** Creates a new Lanceur. */ | ||||
|  | ||||
|   private Lanceur lanceur; | ||||
|    | ||||
|   public Lancerampli(Lanceur lanceur) { | ||||
|   private Limelight limelight; | ||||
|   public Lancerampli(Lanceur lanceur,Limelight limelight) { | ||||
|     // Use addRequirements() here to declare subsystem dependencies. | ||||
|     addRequirements(lanceur); | ||||
|     addRequirements(lanceur, limelight); | ||||
|     this.limelight = limelight; | ||||
|     this.lanceur = lanceur; | ||||
|   } | ||||
|  | ||||
| @@ -28,7 +29,10 @@ public class Lancerampli extends Command { | ||||
|   // Called every time the scheduler runs while the command is scheduled. | ||||
|   @Override | ||||
|   public void execute() { | ||||
|     lanceur.lanceramp(); | ||||
|     if(limelight.getv()){ | ||||
|       lanceur.lanceramp(); | ||||
|     } | ||||
|      | ||||
|   } | ||||
|  | ||||
|   // Called once the command ends or is interrupted. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user