Skip to content

Commit

Permalink
switched to toggle, changed ports
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-tri1 committed Jan 27, 2024
1 parent 06e38a1 commit 21dca7a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public final class Constants {
public static final class HardwarePorts {
// motors (predicted) IDs not fixed
// shooter ports should be correct, climb IDs still predicted
public static final int shooterLeaderM = 21;
public static final int shooterLeaderM = 23;
public static final int shooterFollowerM = 22;
public static final int climbLeaderMotor = 3;
public static final int climbFollowerMotor = 4;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public RobotContainer() {
private void configureBindings() {

// driver controls
driver.a().whileTrue(new TossCommand());
driver.a().onTrue(new TossCommand());

// operator controls

Expand Down
13 changes: 8 additions & 5 deletions src/main/java/frc/robot/commands/TossCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,29 @@
/** An example command that uses an example subsystem. */
public class TossCommand extends Command {
private final ShooterSubsystem s_shooter;
private boolean finish;
private boolean finish = false;
private static boolean running = false;

public TossCommand() {
s_shooter = ShooterSubsystem.getInstance();
addRequirements(s_shooter);
finish = false;
}

@Override
public void initialize() {}

@Override
public void execute() {
s_shooter.setVoltage(10);
finish = true;
if (running) {
s_shooter.setVoltage(0);
} else {
s_shooter.setVoltage(10);
}
}

@Override
public void end(boolean interrupted) {
s_shooter.setVoltage(0);
running = !running;
}

@Override
Expand Down

0 comments on commit 21dca7a

Please sign in to comment.