leds pince
This commit is contained in:
@ -5,15 +5,18 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
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 AlgueExpire extends Command {
|
||||
private Pince pince;
|
||||
private Bougie bougie;
|
||||
/** Creates a new CoralAlgue. */
|
||||
public AlgueExpire(Pince pince) {
|
||||
public AlgueExpire(Pince pince,Bougie bougie) {
|
||||
this.pince = pince;
|
||||
addRequirements(pince);
|
||||
this.bougie = bougie;
|
||||
addRequirements(pince,bougie);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
||||
@ -24,7 +27,14 @@ public class AlgueExpire extends Command {
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
pince.aspirealgue(0.5);
|
||||
if(pince.emperagealgue()>8){
|
||||
pince.aspirealgue(0.5);
|
||||
}
|
||||
else{
|
||||
pince.aspirealgue(0.5);
|
||||
bougie.Jaune();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
|
@ -5,15 +5,18 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
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 CoralAlgueInspire extends Command {
|
||||
private Pince pince;
|
||||
private Bougie bougie;
|
||||
/** Creates a new CoralAlgue. */
|
||||
public CoralAlgueInspire(Pince pince) {
|
||||
public CoralAlgueInspire(Pince pince, Bougie bougie) {
|
||||
this.pince = pince;
|
||||
addRequirements(pince);
|
||||
this.bougie = bougie;
|
||||
addRequirements(pince,bougie);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
||||
@ -27,6 +30,7 @@ public class CoralAlgueInspire extends Command {
|
||||
pince.aspirecoral(-.5);
|
||||
if(pince.emperagealgue()>8){
|
||||
pince.aspirealgue(0);
|
||||
bougie.Bleu();
|
||||
}
|
||||
else{
|
||||
pince.aspirealgue(0.5);
|
||||
|
@ -31,7 +31,7 @@ public class CoralExpire extends Command {
|
||||
}
|
||||
else{
|
||||
pince.aspirecoral(-.5);
|
||||
bougie.Rouge();}
|
||||
bougie.Jaune();}
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
|
@ -27,7 +27,6 @@ public class CoralInspire extends Command {
|
||||
@Override
|
||||
public void execute() {
|
||||
if(pince.emperagecoral()>8){
|
||||
bougie.Vert();
|
||||
pince.aspirecoral(0);
|
||||
}
|
||||
else{
|
||||
|
@ -5,6 +5,7 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
@ -38,6 +39,7 @@ public class L2 extends Command {
|
||||
}
|
||||
if(pince.encodeurpivot()>=500 && pince.encodeurpivot()<=510){
|
||||
pince.pivote(0);
|
||||
|
||||
}
|
||||
else if(pince.encodeurpivot()>=510){
|
||||
pince.pivote(-0.3);
|
||||
@ -45,6 +47,7 @@ public class L2 extends Command {
|
||||
else{
|
||||
pince.pivote(0.3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
|
@ -5,6 +5,7 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
@ -15,7 +16,7 @@ public class L3 extends Command {
|
||||
/** Creates a new L2. */
|
||||
public L3(Elevateur elevateur,Pince pince) {
|
||||
this.elevateur = elevateur;
|
||||
this.pince = pince;
|
||||
this.pince = pince;
|
||||
addRequirements(elevateur,pince);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
|
Reference in New Issue
Block a user