-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/Train' into Train
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/OmegaTeleOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.firstinspires.ftc.teamcode.opmode; | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
import com.qualcomm.robotcore.hardware.DcMotorSimple; | ||
|
||
public class OmegaTeleOp extends LinearOpMode { | ||
private DcMotor topLeftMotor; | ||
private DcMotor topRightMotor; | ||
private DcMotor bottomLeftMotor; | ||
private DcMotor bottomRightMotor; | ||
|
||
private DcMotor trumansArm = hardwareMap.get(DcMotor.class, "arm"); | ||
|
||
@Override | ||
|
||
public void runOpMode() throws InterruptedException { | ||
topLeftMotor = hardwareMap.get(DcMotor.class,"FL"); | ||
topRightMotor = hardwareMap.get(DcMotor.class,"FR"); | ||
bottomLeftMotor = hardwareMap.get(DcMotor.class,"BL"); | ||
bottomRightMotor = hardwareMap.get(DcMotor.class,"BR"); | ||
topLeftMotor.setDirection(DcMotorSimple.Direction.REVERSE); | ||
bottomLeftMotor.setDirection(DcMotorSimple.Direction.REVERSE); | ||
while (opModeIsActive()) { | ||
double y = -gamepad1.left_stick_y; // Y stick is reversed! | ||
double x = gamepad1.left_stick_x; | ||
double rx2 = gamepad1.right_stick_x; | ||
|
||
topLeftMotor.setPower(y + x + rx2); | ||
bottomLeftMotor.setPower(y - x + rx2); | ||
topRightMotor.setPower(y - x - rx2); | ||
bottomRightMotor.setPower(y + x - rx2); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/PIDLOOP.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.firstinspires.ftc.teamcode.opmode; | ||
////this loop is for driving forward and backwards//// | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
|
||
public class PIDLOOP extends LinearOpMode { | ||
public void runOpMode() throws InterruptedException { | ||
|
||
} | ||
} |