Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Käppler
ampel-firmware
Commits
9b764da9
Commit
9b764da9
authored
Dec 27, 2020
by
Eric Duminil
Browse files
Breathing offset
parent
efc613be
Changes
1
Hide whitespace changes
Inline
Side-by-side
led_effects.cpp
View file @
9b764da9
...
...
@@ -176,10 +176,10 @@ namespace LedEffects {
if
(
!
config
::
night_mode
)
{
static
uint16_t
breathing_offset
=
0
;
uint16_t
brightness
=
config
::
min_brightness
+
pixels
.
sine8
(
breathing_offset
*
3
)
*
config
::
brightness_amplitude
/
255
;
+
pixels
.
sine8
(
breathing_offset
)
*
config
::
brightness_amplitude
/
255
;
pixels
.
setBrightness
(
brightness
);
pixels
.
show
();
breathing_offset
++
;
breathing_offset
+=
3
;
// breathing speed. +3 looks like slow human breathing.
}
delay
(
co2
>
1600
?
50
:
100
);
// faster breathing for higher CO2 values
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment