Skip to content

Commit 151ef88

Browse files
committed
found a better name for als variables
1 parent a6b30b5 commit 151ef88

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

examples/ReadALS/ReadALS.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ void setup() {
1111
}
1212

1313
void loop() {
14-
int als;
14+
int rawlux;
1515

16-
if (RGB.readAmbientLight(als)) {
17-
Serial.print("ALS: ");
18-
Serial.println(als);
16+
if (RGB.readAmbientLight(rawlux)) {
17+
Serial.print("Raw Lux: ");
18+
Serial.println(rawlux);
1919
}
2020

2121
delay(1000);

examples/ReadAllSensor/ReadAllSensor.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ void setup() {
1111
}
1212

1313
void loop() {
14-
int r, g, b, als;
14+
int r, g, b, rawlux;
1515
int lux;
1616

17-
if (RGB.readAmbientLight(als)) {
18-
Serial.print("ALS: ");
19-
Serial.print(als);
17+
if (RGB.readAmbientLight(lux)) {
18+
Serial.print("Raw Lux: ");
19+
Serial.print(rawlux);
2020
Serial.print("\t");
2121
}
2222

src/LTR381RGB.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int LTR381RGBClass::readColors(int& r, int& g, int& b) {
120120
return 1;
121121
}
122122

123-
int LTR381RGBClass::readAmbientLight(int& als) {
123+
int LTR381RGBClass::readAmbientLight(int& lux) {
124124
enableALS();
125125
unsigned long start = millis();
126126
while(!available() && (millis() - start) < _timeout);
@@ -129,7 +129,7 @@ int LTR381RGBClass::readAmbientLight(int& als) {
129129
if(res != 1) {
130130
return 0;
131131
}
132-
als = buf[2] << 16 | buf[1] << 8 | buf[0];
132+
lux = buf[2] << 16 | buf[1] << 8 | buf[0];
133133

134134
return 1;
135135
}

src/LTR381RGB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class LTR381RGBClass {
3030

3131
int readColors(int& r, int& g, int& b);
3232

33-
int readAmbientLight(int& als);
33+
int readAmbientLight(int& lux);
3434
int readLux(int& lux);
3535

3636
void setGain(int gain);

0 commit comments

Comments
 (0)