-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestRobotHardwareConfiguration.java
More file actions
46 lines (33 loc) · 1.1 KB
/
TestRobotHardwareConfiguration.java
File metadata and controls
46 lines (33 loc) · 1.1 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
package org.firstinspires.ftc.teamcode.RobotCoreExtensions;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.hardware.DcMotor;
public class TestRobotHardwareConfiguration
{
OpMode opMode;
//Robot Components
public Drivetrain drivetrain;
public DcMotor spinner;
//Sensors
//Auto Drivers
TestRobotHardwareConfiguration(OpMode opMode)
{
this.opMode = opMode;
//Define robot components
DcMotor Left = opMode.hardwareMap.dcMotor.get("left");
DcMotor Right = opMode.hardwareMap.dcMotor.get("right");
Left.setDirection(DcMotor.Direction.REVERSE);
Right.setDirection(DcMotor.Direction.FORWARD);
drivetrain = new Drivetrain.Builder()
.addLeftMotorWithEncoder(Left)
.addRightMotorWithEncoder(Right)
.build();
spinner = opMode.hardwareMap.dcMotor.get("spinner");
//Define sensors
//Define auto drivers
}
void init()
{
spinner.setPower(0);
}
}