diff --git a/ampel-firmware/co2_sensor.cpp b/ampel-firmware/co2_sensor.cpp index 1eb76fc9352de9222d5447107502e3131f170683..25a7102e19088ae65487234f248fada2ed25fd29 100644 --- a/ampel-firmware/co2_sensor.cpp +++ b/ampel-firmware/co2_sensor.cpp @@ -10,6 +10,7 @@ namespace config { const int8_t max_deviation_during_calibration = 30; // [ppm] const int16_t timestep_during_calibration = 10; // [s] WARNING: Measurements can be unreliable for timesteps shorter than 10s. const int8_t stable_measurements_before_calibration = 120 / timestep_during_calibration; // [-] Stable measurements during at least 2 minutes. + const uint16_t co2_alert_threshold = 2000; // [ppm] Display a flashing led ring, if concentration exceeds this value #ifdef TEMPERATURE_OFFSET // Residual heat from CO2 sensor seems to be high enough to change the temperature reading. How much should it be offset? @@ -227,11 +228,11 @@ namespace sensor { * A short delay is required in order to let background tasks run on the ESP8266. * see https://github.com/esp8266/Arduino/issues/3241#issuecomment-301290392 */ - if (co2 < 2000) { + if (co2 < config::co2_alert_threshold) { led_effects::displayCO2color(co2); delay(100); } else { - // >= 2000: entire ring blinks red + // Display a flashing led ring, if concentration exceeds a specific value led_effects::redAlert(); } }