Skip to content

Commit

Permalink
12/21/2020
Browse files Browse the repository at this point in the history
  • Loading branch information
aashrithbandaru committed Dec 22, 2020
1 parent ef03d61 commit 7042ad9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,23 @@ public void runOpModeImpl() {
intake.setPower(0);
}

if (gamepad2.x) {
intake.setPower(1);
if (gamepad2.b)
while (gamepad2.b) {
outtake.setPower(1);
}
else{
outtake.setPower(0);
}

if (gamepad2.y) {
intake.setPower(0);
if (gamepad2.y)
while (gamepad2.y) {
hopper.setPower(1);
}
else{
hopper.setPower(0);
}



// Left trigger - to move left sideways
strafeRight(-gamepad1.right_trigger, 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ abstract class Movement extends LinearOpMode
protected DcMotor leftBack;
protected DcMotor rightBack;
protected DcMotor intake;
protected DcMotor outtake;
protected DcMotor hopper;

public void runOpMode() {
setupDriveMotors();
Expand All @@ -33,6 +35,9 @@ protected void setupDriveMotors() {
rightBack = hardwareMap.get(DcMotor.class, "rightBack");
leftBack = hardwareMap.get(DcMotor.class, "leftBack");
intake = hardwareMap.get(DcMotor.class, "intake");
outtake = hardwareMap.get(DcMotor.class, "outtake");
hopper = hardwareMap.get(DcMotor.class, "hopper");


// Most robots need the motor on one side to be reve`rsed to drive goBackward
// Reverse the motor that runs backwards when connected directly to the battery
Expand All @@ -41,6 +46,9 @@ protected void setupDriveMotors() {
leftBack.setDirection(DcMotor.Direction.FORWARD);
rightBack.setDirection(DcMotor.Direction.REVERSE);
intake.setDirection(DcMotor.Direction.FORWARD);
hopper.setDirection(DcMotor.Direction.FORWARD);
outtake.setDirection(DcMotor.Direction.FORWARD);



/* */
Expand Down

0 comments on commit 7042ad9

Please sign in to comment.