forked from FIRST-Tech-Challenge/FtcRobotController
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTemplateTelemetryAfterPower.java
39 lines (33 loc) · 1.36 KB
/
TemplateTelemetryAfterPower.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
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 = "BasicTestOpMode (Blocks to Java)")
public class TemplateTelemetryAfterPower extends LinearOpMode {
private DcMotor armMotor;
/**
* This sample contains the bare minimum Blocks for any regular OpMode. The 3 blue
* Comment Blocks show where to place Initialization code (runs once, after touching the
* DS INIT button, and before touching the DS Start arrow), Run code (runs once, after
* touching Start), and Loop code (runs repeatedly while the OpMode is active, namely not
* Stopped).
*/
@Override
public void runOpMode() {
float tgtPower;
armMotor = hardwareMap.get(DcMotor.class, "armMotor");
// Put initialization blocks here.
waitForStart();
if (opModeIsActive()) {
// Put run blocks here.
while (opModeIsActive()) {
// Put loop blocks here.
tgtPower = gamepad1.left_stick_y;
armMotor.setPower(tgtPower);
telemetry.addData("TargetPower", tgtPower);
telemetry.addData("MotorPower", armMotor.getPower());
telemetry.update();
}
}
}
}