forked from Hutouben/FTC-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbunch of code
More file actions
50 lines (38 loc) · 1.42 KB
/
bunch of code
File metadata and controls
50 lines (38 loc) · 1.42 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
44
45
46
47
48
49
50
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorSimple;
import com.qualcomm.robotcore.util.ElapsedTime;
@Autonomous(name="Opmodejava")
public class TestAutonomous extends LinearOpMode {
DcMotor motor0 = null;
DcMotor motor1 = null;
DcMotor motor2 = null;
DcMotor motor3 = null;
@Override
public void runOpMode() {
motor0 = hardwareMap.get(DcMotor.class, "backleft");
motor1 = hardwareMap.get(DcMotor.class, "frontleft");
motor2 = hardwareMap.get(DcMotor.class, "frontright");
motor3 = hardwareMap.get(DcMotor.class, "backright");
telemetry.addData("Status", "Initialized");
telemetry.update();
waitForStart();
motor0.setPower(-.5);
motor1.setPower(.5);
motor2.setPower(-.5);
motor3.setPower(.5);
sleep(1000);
motor0.setPower(-.5);
motor1.setPower(.5);
motor2.setPower(-.5);
motor3.setPower(.5);
while (opModeIsActive()) {
telemetry.addData("Status", "Running");
telemetry.update();
}
}
}