Commit 91ba8f01 authored by Käppler's avatar Käppler
Browse files

Breathing acceleration: configurable threshold

The LED breathing effect will double its
speed, if a specific CO2 concentration is
exceeded.
parent 4cb1d3a1
......@@ -66,6 +66,9 @@
// Should the LED display show a breathing effect during measurement?
# define LED_BREATHING true // [true / false]
// Accelerate breathing above this CO2 concentration.
# define LED_BREATHING_ACCEL_THRESHOLD 1600 // [ppm]
/**
* WEB SERVER
......
......@@ -5,6 +5,7 @@
namespace config {
const uint8_t max_brightness = MAX_BRIGHTNESS;
const uint8_t min_brightness = MIN_BRIGHTNESS;
const uint16_t led_breathing_accel_threshold = LED_BREATHING_ACCEL_THRESHOLD;
const int kitt_tail = 3; // How many dimmer LEDs follow in K.I.T.T. wheel
}
......@@ -189,7 +190,7 @@ namespace led_effects {
pixels.setBrightness(brightness);
pixels.show();
breathing_offset += 3; // breathing speed. +3 looks like slow human breathing.
delay(co2 > 1600 ? 50 : 100); // faster breathing for higher CO2 values
delay(co2 > config::led_breathing_accel_threshold ? 50 : 100); // faster breathing for higher CO2 values
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment