Use 256 x oversampling to reduce noise on light sensor
This commit is contained in:
parent
e413703196
commit
6c360d9473
|
@ -335,7 +335,11 @@ void readSensors(void) {
|
|||
output += " ppm, eVOC: " + String(iaqSensor.breathVocEquivalent);
|
||||
output += " ppm";
|
||||
|
||||
int light = analogRead(LIGHT_PIN);
|
||||
int light = 0;
|
||||
for (int n = 0; n < 256; n++) {
|
||||
light += analogRead(LIGHT_PIN);
|
||||
}
|
||||
light = (light + 128) >> 8;
|
||||
output += ", light: " + String(light);
|
||||
Serial.println(output);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue