-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestWheels.java
More file actions
43 lines (37 loc) · 1.26 KB
/
TestWheels.java
File metadata and controls
43 lines (37 loc) · 1.26 KB
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
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
@TeleOp(name = "TestWheels (Blocks to Java)")
public class TestWheels extends LinearOpMode {
private DcMotor right_wheel;
private DcMotor right_wheelback;
private DcMotor left_wheel;
/**
* This function is executed when this OpMode is selected from the Driver Station.
*/
@Override
public void runOpMode() {
float vert;
float horz;
float spin;
right_wheel = hardwareMap.get(DcMotor.class, "right_wheel");
right_wheelback = hardwareMap.get(DcMotor.class, "right_wheel back");
left_wheel = hardwareMap.get(DcMotor.class, "left_wheel");
// Put initialization blocks here.
waitForStart();
if (opModeIsActive()) {
right_wheel.setDirection(DcMotor.Direction.REVERSE);
right_wheelback.setDirection(DcMotor.Direction.REVERSE);
while (opModeIsActive()) {
// Put loop blocks here.
telemetry.update();
vert = -gamepad1.left_stick_y;
horz = gamepad1.left_stick_x;
spin = gamepad1.right_stick_x;
left_wheel.setPower(vert);
// Put run blocks here.
}
}
}
}