diff --git a/ampel-firmware/led_effects.cpp b/ampel-firmware/led_effects.cpp index c2909e6f4db9a64ea5f7302414fafff554c97885..e730e25b8c7c1dee869706c49674a1c38a416413 100644 --- a/ampel-firmware/led_effects.cpp +++ b/ampel-firmware/led_effects.cpp @@ -11,6 +11,7 @@ namespace config { #endif const uint8_t brightness_amplitude = config::max_brightness - config::min_brightness; const int kitt_tail = 3; // How many dimmer LEDs follow in K.I.T.T. wheel + const uint16_t poor_air_quality_ppm = 1600; // Above this threshold, LED breathing effect is faster. //NOTE: Use a class instead? NightMode could then be another state. bool night_mode = false; } @@ -138,7 +139,7 @@ namespace led_effects { + pixels.sine8(breathing_offset) * config::brightness_amplitude / 255; pixels.setBrightness(brightness); pixels.show(); - breathing_offset += co2 > 1600 ? 6 : 3; // breathing speed. +3 looks like slow human breathing. + breathing_offset += co2 > config::poor_air_quality_ppm ? 6 : 3; // breathing speed. +3 looks like slow human breathing. }