-
Notifications
You must be signed in to change notification settings - Fork 1
/
AdaColor.java
56 lines (44 loc) · 1.29 KB
/
AdaColor.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
53
54
55
56
package org.usfirst.FTC5866.opmodes;
/**
* Created by Ollie_2 on 10/5/2015.
*/
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import org.usfirst.FTC5866.library.DataLogger;
//import org.usfirst.FTC5866.library.TCS34725_ColorSensor;
import com.qualcomm.hardware.AdafruitColorSensor;
import com.qualcomm.robotcore.hardware.ColorSensor;
public class AdaColor extends OpMode {
private DataLogger dl;
private ColorSensor cs;
public void init() {
dl = new DataLogger("Ada CS Test");
cs = hardwareMap.colorSensor.get("AdaColor");
dl.addField("Alpha");
dl.addField("Red");
dl.addField("Green");
dl.addField("Blue");
dl.newLine();
}
public void init_loop() {
}
public void start() {
}
@Override
public void loop() {
int clearValue,red,green,blue;
clearValue = cs.alpha();
telemetry.addData("Clear = ", clearValue);
red = cs.red();
green = cs.green();
blue = cs.blue();
dl.addField(clearValue);
dl.addField(red);
dl.addField(green);
dl.addField(blue);
dl.newLine();
}
public void stop() {
dl.closeDataLogger();
cs.close();
}
}