-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTWARobotHardwareConfiguration.java
More file actions
48 lines (36 loc) · 1.32 KB
/
TWARobotHardwareConfiguration.java
File metadata and controls
48 lines (36 loc) · 1.32 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
package org.firstinspires.ftc.teamcode.RobotCoreExtensions;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.hardware.DcMotor;
public class TWARobotHardwareConfiguration
{
OpMode opMode;
//Robot Components
public Drivetrain drivetrain;
//Sensors
//Auto Drivers
TWARobotHardwareConfiguration(OpMode opMode)
{
this.opMode = opMode;
//Define robot components
DcMotor left1 = opMode.hardwareMap.dcMotor.get("left1");
DcMotor left2 = opMode.hardwareMap.dcMotor.get("left2");
DcMotor right1 = opMode.hardwareMap.dcMotor.get("right1");
DcMotor right2 = opMode.hardwareMap.dcMotor.get("right2");
left1.setDirection(DcMotor.Direction.REVERSE);
left2.setDirection(DcMotor.Direction.REVERSE);
right1.setDirection(DcMotor.Direction.FORWARD);
right2.setDirection(DcMotor.Direction.FORWARD);
drivetrain = new Drivetrain.Builder()
.addLeftMotorWithEncoder(left1)
.addLeftMotorWithEncoder(left2)
.addRightMotorWithEncoder(right1)
.addRightMotorWithEncoder(right2)
.build();
//Define sensors
//Define auto drivers
}
void init()
{
// :) oh happy day, there is nothing here. :)
}
}