Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #92 from rh-robotics/teo-intake-teleop
Browse files Browse the repository at this point in the history
New TeleOp intake things
  • Loading branch information
DragonDev07 authored Feb 19, 2024
2 parents 1d06245 + 89f1129 commit 130e4c1
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ public void loop() {

// ------ (GAMEPAD 1) Intake Toggle Controls ------ //
if (robot.currentGamepad1.right_bumper && !robot.previousGamepad1.right_bumper) {
intakeState = IntakeState.INTAKE;
if (intakeState == IntakeState.INTAKE || intakeState == IntakeState.OUTTAKE) { intakeState = IntakeState.OFF; }
else if (intakeState == IntakeState.OFF) { intakeState = IntakeState.INTAKE; }
}

if (robot.currentGamepad1.left_bumper && !robot.previousGamepad1.left_bumper) {
intakeState = IntakeState.OUTTAKE;
}
if ((robot.currentGamepad1.left_bumper && !robot.previousGamepad1.left_bumper) && (robot.currentGamepad1.right_bumper && !robot.previousGamepad1.right_bumper)) {
intakeState = IntakeState.OFF;
if (intakeState == IntakeState.INTAKE || intakeState == IntakeState.OUTTAKE) {
intakeState = IntakeState.OFF;
} else if (intakeState == IntakeState.OFF) { intakeState = IntakeState.OUTTAKE; }
}

// ------ (GAMEPAD 1) MANUAL Wrist Controls ------ //
if (robot.currentGamepad1.dpad_up && !robot.previousGamepad1.dpad_up) {
wristPosition += 0.05;
Expand All @@ -196,9 +196,6 @@ public void loop() {
passoverPosition -= 0.05;
}

// ------ (GAMEPAD 2) MANUAL Intake Controls ------ //
robot.intakeMotor.setPower(robot.currentGamepad2.right_stick_x);

// ------ Run Motors ------ //
robot.leftFront.setPower(leftFPower);
robot.leftRear.setPower(leftBPower);
Expand All @@ -216,7 +213,7 @@ public void loop() {
robot.intakeMotor.setPower(-1);
break;
case OFF:
robot.intakeMotor.setPower(0);
robot.intakeMotor.setPower(robot.currentGamepad2.right_stick_x);
break;
case OUTTAKE:
robot.intakeMotor.setPower(1);
Expand Down

0 comments on commit 130e4c1

Please sign in to comment.