-
Notifications
You must be signed in to change notification settings - Fork 0
/
TimingDemo.java
40 lines (30 loc) · 999 Bytes
/
TimingDemo.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
// simple teleop program that demonstrates timing issues.
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
@TeleOp(name="Timing Demo", group="Exercises")
//@Disabled
public class TimingDemo extends LinearOpMode
{
int buttonCount;
boolean bButton;
// called when init button is pressed.
@Override
public void runOpMode() throws InterruptedException
{
telemetry.addData("Mode", "waiting");
telemetry.update();
// wait for start button.
waitForStart();
while (opModeIsActive())
{
if (gamepad1.a) buttonCount += 1;
if (gamepad1.b) bButton = !bButton;
telemetry.addData("Mode", "running");
telemetry.addData("A button Count", buttonCount);
telemetry.addData("B button", bButton);
telemetry.update();
idle();
}
}
}