bougie fini(J'espere)

This commit is contained in:
Antoine PerreaultE
2025-02-27 20:23:26 -05:00
parent 58025b4bbd
commit 18222d9f55
10 changed files with 79 additions and 69 deletions

View File

@@ -5,15 +5,19 @@
package frc.robot.commands.requin;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Requin;
/* 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 ExpireAlgue extends Command {
private Requin requin;
private Bougie bougie;
/** Creates a new ExpireAlgue. */
public ExpireAlgue(Requin requin) {
public ExpireAlgue(Requin requin, Bougie bougie
) {
this.requin = requin;
addRequirements(requin);
this.bougie = bougie;
addRequirements(requin,bougie);
// Use addRequirements() here to declare subsystem dependencies.
}
@@ -24,7 +28,14 @@ public class ExpireAlgue extends Command {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
requin.balaye(0.5);
if(requin.amp()> 60){
requin.balaye(-0.5);
}
else
{
bougie.Rouge();
requin.balaye(-0.5);
}
}
// Called once the command ends or is interrupted.

View File

@@ -30,7 +30,7 @@ public class L1Requin extends Command {
if(requin.encodeur()>=800 && requin.encodeur()<=810){
requin.rotationer(0);
if(requin.amp()>8){
if(requin.amp()>60){
requin.balaye(-0.5);
}
else{

View File

@@ -5,16 +5,19 @@
package frc.robot.commands.requin;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Requin;
/* 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 aspire extends Command {
/** Creates a new aspire. */
private Requin requin;
public aspire(Requin requin) {
private Bougie bougie;
public aspire(Requin requin, Bougie bougie) {
// Use addRequirements() here to declare subsystem dependencies.
this.requin = requin;
addRequirements(requin);
this.bougie = bougie;
addRequirements(requin, bougie);
}
// Called when the command is initially scheduled.
@@ -24,7 +27,14 @@ public class aspire extends Command {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
requin.balaye(0.3);
if(requin.amp()> 60){
requin.balaye(0);
bougie.Vert();
}
else
{
requin.balaye(0.5);
}
}
// Called once the command ends or is interrupted.

View File

@@ -5,16 +5,21 @@
package frc.robot.commands.requin;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.Requin;
/* 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 exspire extends Command {
/** Creates a new aspire. */
private Requin requin;
public exspire(Requin requin) {
private Bougie bougie
;
public exspire(Requin requin,Bougie bougie) {
// Use addRequirements() here to declare subsystem dependencies.
this.requin = requin;
addRequirements(requin);
this.bougie
=bougie;
addRequirements(requin,bougie);
}
// Called when the command is initially scheduled.
@@ -24,7 +29,14 @@ public class exspire extends Command {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
requin.balaye(-0.3);
if(requin.amp()> 60){
requin.balaye(-0.5);
}
else
{
bougie.Rouge();
requin.balaye(-0.5);
}
}
// Called once the command ends or is interrupted.