-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPulseDrive.java
50 lines (35 loc) · 1.34 KB
/
PulseDrive.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
package org.firstinspires.ftc.teamcode.Subsystems;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.HardwareMap;
/**
* Created by John Paul Ashour on 11/5/2016.
*/
public class PulseDrive {
public DcMotor Left1 = null;
public DcMotor Left2 = null;
public DcMotor Right1 = null;
public DcMotor Right2 = null;
HardwareMap hwMap = null;
public PulseDrive() {
}
public void init(HardwareMap ahwMap) {
// Save reference to Hardware map
hwMap = ahwMap;
Left1 = hwMap.dcMotor.get("Left 1");
Left2 = hwMap.dcMotor.get("Left 2");
Right1 = hwMap.dcMotor.get("Right 1");
Right2 = hwMap.dcMotor.get("Right 2");
Left1.setDirection(DcMotor.Direction.REVERSE);
Left2.setDirection(DcMotor.Direction.REVERSE);
Right1.setDirection(DcMotor.Direction.FORWARD);
Right2.setDirection(DcMotor.Direction.FORWARD);
Left1.setPower(0);
Left2.setPower(0);
Right1.setPower(0);
Right2.setPower(0);
//Left1.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
//Left2.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
//Right1.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
//Right2.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
}
}