Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
thk_led_strip_controller
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thk_libs
microcontrollers
thk_led_strip_controller
Commits
e43d8b7d
Commit
e43d8b7d
authored
May 19, 2022
by
Orhan-Timo Altan
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
5a0558b1
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/ledshow/ledshow.ino
+3
-8
3 additions, 8 deletions
examples/ledshow/ledshow.ino
ledstrip.cpp
+10
-0
10 additions, 0 deletions
ledstrip.cpp
ledstrip.h
+2
-0
2 additions, 0 deletions
ledstrip.h
with
15 additions
and
8 deletions
examples/ledshow/ledshow.ino
+
3
−
8
View file @
e43d8b7d
#include
<ledstrip.h>
#include
<ledstrip.h>
// Ledstrip front_strip(6,35);
Ledstrip
front_strip
(
6
,
33
);
// Ledstrip back_strip(6,37);
Ledstrip
back_strip
(
6
,
37
);
// Ledstrip left_strip(3, 33);
Ledstrip
left_strip
(
3
,
35
);
// Ledstrip rigth_strip(3, 39);
Ledstrip
front_strip
(
13
,
37
);
Ledstrip
back_strip
(
24
,
35
);
Ledstrip
left_strip
(
3
,
33
);
Ledstrip
rigth_strip
(
3
,
39
);
Ledstrip
rigth_strip
(
3
,
39
);
bool
state
=
true
;
bool
state
=
true
;
...
...
This diff is collapsed.
Click to expand it.
ledstrip.cpp
+
10
−
0
View file @
e43d8b7d
...
@@ -31,6 +31,16 @@ void Ledstrip::show() {
...
@@ -31,6 +31,16 @@ void Ledstrip::show() {
ptrStrip
->
show
();
ptrStrip
->
show
();
}
}
uint32_t
Ledstrip
::
color_hsv
(
int
pixelHue
)
{
pixelHue
=
ptrStrip
->
ColorHSV
(
pixelHue
);
return
pixelHue
;
}
uint32_t
Ledstrip
::
gamma
(
int
pixelHue
)
{
pixelHue
=
ptrStrip
->
gamma32
(
color_hsv
(
pixelHue
));
return
pixelHue
;
}
void
Ledstrip
::
blink
(
uint32_t
color
,
unsigned
long
wait_time
)
{
void
Ledstrip
::
blink
(
uint32_t
color
,
unsigned
long
wait_time
)
{
ptrStrip
->
clear
();
ptrStrip
->
clear
();
set_pixel_color
(
color
);
set_pixel_color
(
color
);
...
...
This diff is collapsed.
Click to expand it.
ledstrip.h
+
2
−
0
View file @
e43d8b7d
...
@@ -27,6 +27,8 @@ class Ledstrip {
...
@@ -27,6 +27,8 @@ class Ledstrip {
void
set_pixel_color
(
uint16_t
index
,
uint32_t
color
);
void
set_pixel_color
(
uint16_t
index
,
uint32_t
color
);
void
set_pixel_color
(
uint16_t
index
,
uint16_t
amount
,
uint32_t
color
);
void
set_pixel_color
(
uint16_t
index
,
uint16_t
amount
,
uint32_t
color
);
void
show
();
void
show
();
uint32_t
color_hsv
(
int
pixelHue
);
uint32_t
gamma
(
int
pixelHue
);
void
blink
(
uint32_t
color
,
unsigned
long
wait_time
);
void
blink
(
uint32_t
color
,
unsigned
long
wait_time
);
void
rainbow_effect
(
unsigned
long
wait_time
);
void
rainbow_effect
(
unsigned
long
wait_time
);
void
running_light
(
unsigned
long
wait_time
=
100
,
uint8_t
length
=
2
,
uint32_t
color
=
50
,
bool
direction
=
true
);
void
running_light
(
unsigned
long
wait_time
=
100
,
uint8_t
length
=
2
,
uint32_t
color
=
50
,
bool
direction
=
true
);
...
...
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