Skip to content

Commit

Permalink
Task 7 Completion
Browse files Browse the repository at this point in the history
  • Loading branch information
InfinityJuice committed Oct 12, 2024
1 parent 69069b1 commit 367a443
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ private void configureButtonBindings() {
//in a RepeatCommand to repeat, and replace the type of moveServoUp and moveServoDown(or whatever they are called) with that type of Command.
//Then, delete the RepeatCommand, because your command should already repeat.

// m_controller.y().whileTrue(new RepeatCommand(null));
// m_controller.a().whileTrue(new RepeatCommand(null));
m_controller.y().whileTrue(ServoCommands.servoAdjustAngleCommand(1));
m_controller.a().whileTrue(ServoCommands.servoAdjustAngleCommand(-1));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/commands/ServoCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import edu.wpi.first.wpilibj2.command.FunctionalCommand;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;

public class ServoCommands {
Expand All @@ -23,7 +24,7 @@ public class ServoCommands {
//TODO: Task 6-Write commands to move the arm up, down, and to a specific preset. The latter should be done by taking in an integer input.
//The presets are in the constants file.
public static Command servoAdjustAngleCommand(double adjustAmount) {
return new InstantCommand(
return new RunCommand(
() -> hiIhopeThisWorks.adjustAngleBy(adjustAmount)
);
}
Expand Down

0 comments on commit 367a443

Please sign in to comment.