Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
multipass
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
multipass
Commits
eb75130b
Commit
eb75130b
authored
5 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
blinkencat3: decrease default brightness
parent
ae87fe14
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/blinkencat3/main.cc
+30
-11
30 additions, 11 deletions
src/app/blinkencat3/main.cc
with
30 additions
and
11 deletions
src/app/blinkencat3/main.cc
+
30
−
11
View file @
eb75130b
...
...
@@ -21,8 +21,11 @@ class Blinkencat {
RGBWHEEL_SLOW
,
RGBFADE_FAST
,
RGBFADE_SLOW
,
BRIGHTRGBWHEEL_FAST
,
BRIGHTRGBWHEEL_SLOW
,
BRIGHTRGBFADE_FAST
,
BRIGHTRGBFADE_SLOW
,
COLD_WHITE
,
BEEDOO
,
STROBE
,
COLOR_STROBE
,
MODE_ENUM_MAX
...
...
@@ -139,7 +142,6 @@ void Blinkencat::loop(void)
{
static
uint16_t
rgbwheel_offset
=
0
;
static
uint16_t
rgbfade_hsv
=
0
;
static
uint8_t
beedoo_pos
=
0
;
static
uint8_t
strobe_on
=
0
;
/*
...
...
@@ -168,7 +170,7 @@ void Blinkencat::loop(void)
case
RGBWHEEL_SLOW
:
for
(
uint16_t
i
=
0
;
i
<
NUM_PIXELS
;
i
++
)
{
uint16_t
hsv
=
(
i
*
252
+
rgbwheel_offset
)
%
6553
;
np
.
setPixelColor
(
i
,
np
.
gamma32
(
np
.
ColorHSV
(
hsv
*
10
)));
np
.
setPixelColor
(
i
,
np
.
gamma32
(
np
.
ColorHSV
(
hsv
*
10
,
255
,
127
)));
}
rgbwheel_offset
=
(
rgbwheel_offset
+
10
)
%
6553
;
np
.
show
();
...
...
@@ -180,7 +182,7 @@ void Blinkencat::loop(void)
case
RGBFADE_FAST
:
case
RGBFADE_SLOW
:
for
(
uint16_t
i
=
0
;
i
<
NUM_PIXELS
;
i
++
)
{
np
.
setPixelColor
(
i
,
np
.
ColorHSV
(
rgbfade_hsv
*
10
));
np
.
setPixelColor
(
i
,
np
.
ColorHSV
(
rgbfade_hsv
*
10
,
255
,
63
));
}
rgbfade_hsv
=
(
rgbfade_hsv
+
10
)
%
6553
;
np
.
show
();
...
...
@@ -189,20 +191,37 @@ void Blinkencat::loop(void)
_delay_ms
(
99
);
}
break
;
case
COLD_WHITE
:
case
BRIGHTRGBWHEEL_FAST
:
case
BRIGHTRGBWHEEL_SLOW
:
for
(
uint16_t
i
=
0
;
i
<
NUM_PIXELS
;
i
++
)
{
np
.
setPixelColor
(
i
,
np
.
Color
(
127
,
127
,
127
));
uint16_t
hsv
=
(
i
*
252
+
rgbwheel_offset
)
%
6553
;
np
.
setPixelColor
(
i
,
np
.
gamma32
(
np
.
ColorHSV
(
hsv
*
10
)));
}
rgbwheel_offset
=
(
rgbwheel_offset
+
10
)
%
6553
;
np
.
show
();
sleep
();
_delay_ms
(
1
);
if
(
mode
==
BRIGHTRGBWHEEL_SLOW
)
{
_delay_ms
(
9
);
}
break
;
case
BEEDOO
:
case
BRIGHTRGBFADE_FAST
:
case
BRIGHTRGBFADE_SLOW
:
for
(
uint16_t
i
=
0
;
i
<
NUM_PIXELS
;
i
++
)
{
np
.
setPixelColor
(
i
,
np
.
Color
(
0
,
0
,
(
i
+
2
-
beedoo_pos
<=
2
)
*
255
));
np
.
setPixelColor
(
i
,
np
.
Color
HSV
(
rgbfade_hsv
*
10
));
}
rgbfade_hsv
=
(
rgbfade_hsv
+
10
)
%
6553
;
np
.
show
();
beedoo_pos
=
(
beedoo_pos
+
1
)
%
NUM_PIXELS
;
_delay_ms
(
20
);
_delay_ms
(
1
);
if
(
mode
==
BRIGHTRGBFADE_SLOW
)
{
_delay_ms
(
99
);
}
break
;
case
COLD_WHITE
:
for
(
uint16_t
i
=
0
;
i
<
NUM_PIXELS
;
i
++
)
{
np
.
setPixelColor
(
i
,
np
.
Color
(
127
,
127
,
127
));
}
np
.
show
();
sleep
();
break
;
case
STROBE
:
for
(
uint16_t
i
=
0
;
i
<
NUM_PIXELS
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment