Skip to content

Commit

Permalink
In progress x2
Browse files Browse the repository at this point in the history
  • Loading branch information
ChloeT09 committed Nov 22, 2024
1 parent 72dd58e commit cf22849
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public static class Locks {
@HardwareName("wrist")
public Servo wrist;

@HardwareName("frontClaw")
public Servo frontClaw;

@HardwareName("clawFlip")
public Servo clawFlip;


@Override
public Encoder getLeftEncoder() { return encoderLeft; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ else if(gamepad2.dpad_down){
}*/
lift(hardware);
arm(hardware);
HorizontalServos(hardware);
int verticalPosition = hardware.encoderVerticalSlide.getCurrentPosition();
telemetry.addData("Vertical position", verticalPosition);
telemetry.addData("fl power", frontLeftPower);
Expand Down Expand Up @@ -246,4 +247,21 @@ private void arm(Hardware hardware) {
arm.setPower(emerg ? 1.0 : 0.3);
telemetry.addData("arm deg", degrees);
}
public void HorizontalServos(Hardware hardware) {
double moveFlip = 0;
hardware.clawFlip.setPosition(moveFlip);
double closeFrontClaw = 0.55;
double openFrontClaw = 0.02;
if (gamepad1.right_bumper) {
hardware.frontClaw.setPosition(openFrontClaw);
} else if (gamepad1.left_bumper) {
hardware.frontClaw.setPosition(closeFrontClaw);
} if (gamepad1.y){
moveFlip += 0.01;
}
else if (gamepad1.b) {
moveFlip += -0.01;
}
hardware.clawFlip.setPosition(moveFlip);
}
}

0 comments on commit cf22849

Please sign in to comment.