Skip to content

Commit

Permalink
made feeder commands request zero voltage after ending
Browse files Browse the repository at this point in the history
Signed-off-by: a1cd <[email protected]>
  • Loading branch information
a1cd committed Mar 27, 2024
1 parent 7c0c524 commit 2ba1cc6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/main/java/frc/robot/commands/FeederCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.StartEndCommand;
import frc.robot.subsystems.feeder.Feeder;

import static edu.wpi.first.wpilibj2.command.Commands.*;
Expand All @@ -27,15 +28,15 @@ public static Command feedToShooter(Feeder feeder) {
.onlyIf(feeder::getBeamBroken)
.until(() -> !feeder.getBeamBroken()),
run(() -> feeder.runVolts(12), feeder)
.withTimeout(0.5)
.withTimeout(0.5),
runOnce(() -> feeder.runVolts(0.0))
);
}

public static Command flushFeeder(Feeder feeder) {
return new RunCommand(
() -> {
feeder.runVolts(-4);
},
return startEnd(
() -> feeder.runVolts(-4),
() -> feeder.runVolts(0.0),
feeder);
}

Expand Down Expand Up @@ -72,9 +73,10 @@ private static Command zeroToBeamBreak(Feeder feeder) {
}

public static Command humanPlayerIntake(Feeder feeder) {
return run(() -> {
feeder.runVolts(-2.0);
});
return startEnd(
() -> feeder.runVolts(-2.0),
()-> feeder.runVolts(0)
);
}

// public static Command feedToBeamBreak(Feeder feeder) {
Expand Down

0 comments on commit 2ba1cc6

Please sign in to comment.