Skip to content

Commit

Permalink
CAN GET 4TH SAMPLE NOW YAY
Browse files Browse the repository at this point in the history
  • Loading branch information
luenix1 committed Jan 15, 2025
1 parent 70d6130 commit 20ab4f8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void hardwareInit() {
hardware.arm.setPower(0.3);
hardware.wrist.setPosition(0.28);
hardware.claw.setPosition(Hardware.CLAW_CLOSE);

hardware.clawTwist.setPosition(Hardware.CLAW_TWIST_INIT);
// we don't have the proxy object to handle this for us
// so manually implement the inversion
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_IN);
Expand All @@ -88,6 +88,9 @@ public void runOpMode() {
if (gamepad1.b){
SlideIn();
}
if (gamepad1.x){
FourthSample();
}

telemetry.addData("slidePos", hardware.horizontalLeft.getPosition());
telemetry.addData("slidePos2", hardware.horizontalSlide.getPosition());
Expand All @@ -114,4 +117,27 @@ public void SlideIn() {
hardware.horizontalLeft.setPosition(1-Hardware.RIGHT_SLIDE_IN);
hardware.clawFlip.setPosition(Hardware.FLIP_UP);
}
public void FourthSample(){
double PartialFlip = 0.167;
hardware.clawFlip.setPosition(PartialFlip);
sleep(500);
hardware.clawTwist.setPosition(0.26);
sleep(500);
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_OUT);
hardware.horizontalLeft.setPosition(1-Hardware.RIGHT_SLIDE_OUT);
sleep(500);
hardware.clawFlip.setPosition(Hardware.FLIP_DOWN);
sleep(500);
hardware.clawFront.setPosition(Hardware.FRONT_CLOSE);
sleep(500);
hardware.clawTwist.setPosition(Hardware.CLAW_TWIST_INIT);
sleep(500);
hardware.horizontalSlide.setPosition(Hardware.SLIDE_OVERSHOOT);
hardware.horizontalLeft.setPosition(1 - Hardware.SLIDE_OVERSHOOT);
sleep(500);
hardware.horizontalSlide.setPosition(Hardware.RIGHT_SLIDE_IN);
hardware.horizontalLeft.setPosition(1-Hardware.RIGHT_SLIDE_IN);
sleep(500);
hardware.clawFlip.setPosition(Hardware.FLIP_UP);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public static class Locks {
@HardwareName("clawFlip")
public Servo clawFlip;

@HardwareName("clawTwist")
public Servo clawTwist;

@HardwareName("horizontalSlide")
public Servo horizontalSlide;

Expand All @@ -156,6 +159,7 @@ public static class Locks {
@HardwareName("clawColor")
public ColorSensor clawColor;


@Override
public Encoder getLeftEncoder() {
return encoderLeft;
Expand Down

0 comments on commit 20ab4f8

Please sign in to comment.