Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
c3d8c797
Commit
c3d8c797
authored
Apr 23, 2021
by
Eric Duminil
Browse files
Allow to set color
parent
8ca175d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/led_effects.cpp
View file @
c3d8c797
...
...
@@ -70,11 +70,19 @@ namespace led_effects {
onBoardLEDOff
();
}
void
showColor
(
int32_t
color
)
{
config
::
night_mode
=
true
;
// In order to avoid overwriting the desired color next time CO2 is displayed
pixels
.
setBrightness
(
255
);
pixels
.
fill
(
color
);
pixels
.
show
();
}
void
setupRing
()
{
pixels
.
begin
();
pixels
.
setBrightness
(
config
::
max_brightness
);
LEDsOff
();
sensor_console
::
defineCommand
(
"night_mode"
,
toggleNightMode
,
F
(
" (Toggles night mode on/off)"
));
sensor_console
::
defineIntCommand
(
"color"
,
showColor
,
F
(
" 0xFF0015 (Shows color, specified as RGB, for debugging)"
));
}
void
toggleNightMode
()
{
...
...
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