-
Notifications
You must be signed in to change notification settings - Fork 1
/
BananaWheelsRobot.java
52 lines (34 loc) · 1.51 KB
/
BananaWheelsRobot.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
41
42
43
44
45
46
47
48
49
50
51
52
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.HardwareMap;
public class BananaWheelsRobot {
public DcMotor bottomRight = null;
public DcMotor topRight = null;
public DcMotor topLeft = null;
public DcMotor bottomLeft = null;
HardwareMap hardwareMap = null;
public BananaWheelsRobot() {
}
public void init(HardwareMap omegaSquadHardwareMap) {
hardwareMap = omegaSquadHardwareMap;
//Initialize all DC Motors
bottomRight = hardwareMap.dcMotor.get("bottomRight");
topLeft = hardwareMap.dcMotor.get("topLeft");
topRight = hardwareMap.dcMotor.get("topRight");
bottomLeft = hardwareMap.dcMotor.get("bottomLeft");
topLeft.setDirection(DcMotor.Direction.FORWARD);
bottomLeft.setDirection(DcMotor.Direction.FORWARD);
topRight.setDirection(DcMotor.Direction.REVERSE);
bottomRight.setDirection(DcMotor.Direction.REVERSE);
//Set all DC Motors power to ZERO
topLeft.setPower(0);
bottomLeft.setPower(0);
topRight.setPower(0);
bottomRight.setPower(0);
//Set all motors to run without encoders
topLeft.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
bottomLeft.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
topRight.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
bottomRight.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
}
}