-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteleOp.java
44 lines (32 loc) · 1.25 KB
/
teleOp.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package org.firstinspires.ftc.teamcode;
import static java.lang.Math.abs;
import static java.lang.Math.max;
import com.arcrobotics.ftclib.command.CommandOpMode;
import com.arcrobotics.ftclib.gamepad.GamepadEx;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.CRServoImplEx;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorEx;
import com.qualcomm.robotcore.hardware.Gamepad;
import com.qualcomm.robotcore.hardware.ServoImplEx;
@TeleOp
public class teleOp extends CommandOpMode {
//Create variables here
public Drivebase drivebase;
public Intake intake;
@Override
public void initialize() {
//Initialize everything here. This runs when init is pressed.
drivebase = new Drivebase(hardwareMap);
intake = new Intake(hardwareMap);
}
@Override
public void run() {
super.run();
//This runs once you press run and repeats until you press stop.
drivebase.drive(gamepad1.left_stick_y, gamepad1.left_stick_x, gamepad1.right_stick_x);
if (gamepad2.left_trigger > 0.05 || gamepad2.right_trigger > 0.05) {
intake.setPower(gamepad2.left_trigger-gamepad2.right_trigger);
}
}
}