Skip to content

Commit

Permalink
update comp control
Browse files Browse the repository at this point in the history
  • Loading branch information
Lu-han-wang committed Feb 24, 2024
1 parent e840dfc commit 148bd9e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/jmhsrobotics/frc2024/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private void configureBindings() {
this.control.presetHigh().onTrue(new ArmSetAmpCommand(this.armSubsystem));
this.control.presetMid().onTrue(new ArmSetShootCommand(this.armSubsystem));
this.control.presetLow().onTrue(new ArmSetPickupCommand(this.armSubsystem));
this.control.intakeInput().onTrue(new IntakeCommand(0.5, this.intakeSubsystem, this.shooterSubsystem));
this.control.intakeInput().while True(new IntakeCommand(0.5, this.intakeSubsystem, this.shooterSubsystem));
this.control.extakeInput().whileTrue(new IntakeCommand(-0.5, this.intakeSubsystem, this.shooterSubsystem));
this.control.shooterInput().whileTrue(new ShootOpenLoopCommand(80, shooterSubsystem));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.jmhsrobotics.frc2024.controlBoard;

import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj.event.EventLoop;
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import edu.wpi.first.wpilibj2.command.button.Trigger;

Expand Down Expand Up @@ -58,7 +57,7 @@ public Trigger presetLow() {
public Trigger intakeInput() {
// return new JoystickButton(this.operator,
// XboxController.Axis.kRightTrigger.value);
return new JoystickButton(this.operator, 0);
return new Trigger(this::intakeInputSupplier);
}

// idk wtf an EventLoop is to do this properly with operator.leftTrigger() but
Expand All @@ -67,6 +66,10 @@ private boolean extakeInputSupplier() {
return operator.getLeftTriggerAxis() > 0.5;
}

private boolean intakeInputSupplier() {
return this.operator.getRightTriggerAxis() > 0.5;
}

@Override
public Trigger extakeInput() {
// return new JoystickButton(this.operator, );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public IntakeSubsystem() {
this.lowerSensor.setRangingMode(RangingMode.Short, 24);
this.upperSensor.setRangingMode(RangingMode.Short, 24);


if (RobotBase.isSimulation()) {
simInit();
}
Expand Down

0 comments on commit 148bd9e

Please sign in to comment.