-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCapballHolder.java
49 lines (40 loc) · 1.34 KB
/
CapballHolder.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
package org.firstinspires.ftc.teamcode.Subsystems;
import com.qualcomm.robotcore.hardware.HardwareMap;
import com.qualcomm.robotcore.hardware.Servo;
/**
* Created by Owner_2 on 11/26/2016.
*/
public class CapballHolder {
public Servo capballHolderServo = null;
public boolean isBallCaptured = false;
private enum capballHolderServoEnum {Captured, Released, Colapsed}
capballHolderServoEnum capballHolderServoState = capballHolderServoEnum.Colapsed;
public CapballHolder(String capballHolderServo, HardwareMap hardwareMap){
this.capballHolderServo = hardwareMap.servo.get(capballHolderServo);
this.colapsed();
}
public void released(){
capballHolderServo.setPosition(0);
isBallCaptured = false;
}
public void captured(){
capballHolderServo.setPosition(0.3);
isBallCaptured = true;
}
public void colapsed(){
capballHolderServo.setPosition(0.95);
}
@Override
public String toString(){
switch (capballHolderServoState){
case Released:
return "Ball Released";
case Captured:
return "Ball Captured";
case Colapsed:
return "Arm Colapsed";
default:
return "unknown";
}
}
}