This repository has been archived by the owner on Aug 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLightSensors.ino
66 lines (52 loc) · 1.69 KB
/
LightSensors.ino
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
57
58
59
60
61
62
63
64
65
66
#include <QTRSensors.h>
QTRSensorsRC qtrrc((unsigned char[]) {23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53}, 16); // 16 sensor array
//QTRSensorsRC li ((unsigned char[]) {23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 47, 49, 51}, 14); // 14 sensor array
//ommitted sensors 11 - 15
void setup() {
Serial.begin(9600);
Serial.print("test");
qtrrc.emittersOn();
for(int i = 0; i < 400; i++) {
qtrrc.calibrate();
delay(20);
Serial.println(i);
}
Serial.begin(9600);
Serial.println("finished\n");
Serial.print("unsigned int CalibratedMinVals[] = {");
for(int i = 0; i < 16; i ++) {
Serial.print(qtrrc.calibratedMinimumOn[i]);
Serial.print(", ");
}
Serial.print("};\nunsigned int CalibratedMaxVals[] = {");
for(int i = 0; i < 16;i ++) {
Serial.print(qtrrc.calibratedMaximumOn[i]);
Serial.print(", ");
}
Serial.print("};\n");
Serial.println("Light Differences");
for(int i = 0; i < 16; i++) {
Serial.print(i);
Serial.print(": ");
Serial.println(qtrrc.calibratedMaximumOn[i] - qtrrc.calibratedMinimumOn[i]);
}
/*
for(int i = 0; i < 16; i++ ) {
Serial.print("Minimum Value ");
Serial.print(i);
Serial.print(": ");
Serial.print(qtrrc.calibratedMinimumOn[i]);
Serial.print("\n");
}
for(int i = 0; i < 16; i++ ) {
Serial.print("Maximum Value ");
Serial.print(i);
Serial.print(": ");
Serial.print(qtrrc.calibratedMaximumOn[i]);
Serial.print("\n");
}
*/
}
void loop() {
//Serial.print("Loop entered");
}