From 62016309f3e3ec8a82e8544a20eb8af69488caef Mon Sep 17 00:00:00 2001 From: Eric Duminil Date: Thu, 15 Apr 2021 20:49:21 +0200 Subject: [PATCH] Adding poor_air_quality_ppm constant. --- ampel-firmware/led_effects.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ampel-firmware/led_effects.cpp b/ampel-firmware/led_effects.cpp index c2909e6..e730e25 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. } -- GitLab