Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
T
test-project-please-ignore
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Progetti
test-project-please-ignore
Commits
f7dc6e32
Commit
f7dc6e32
authored
Oct 21, 2018
by
Federico Meloda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another test with leds
parent
80d3bb7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
lighting.py
lighting.py
+9
-18
No files found.
lighting.py
View file @
f7dc6e32
...
...
@@ -25,7 +25,7 @@ class Color:
class
ColorManager
(
Thread
):
pow_time
=
1000
0
pow_time
=
0
current_rand
=
1
current_color
=
Color
(
0
,
0
,
0
)
stato
=
0
...
...
@@ -42,32 +42,23 @@ class ColorManager(Thread):
def
get_color
(
self
):
if
self
.
current_color
.
green
+
self
.
current_rand
>
80
:
if
self
.
current_color
.
green
+
self
.
current_rand
>
(
80
-
(
self
.
pow_time
/
4000
)
:
self
.
current_rand
=
-
randint
(
1
,
8
)
self
.
current_color
=
Color
(
80
,
255
,
30
)
self
.
current_color
=
Color
(
80
-
(
50
*
self
.
pow_time
/
10000
)
,
255
,
30
)
elif
self
.
current_color
.
green
+
self
.
current_rand
<
0
:
self
.
current_rand
=
randint
(
1
,
8
)
self
.
current_color
=
Color
(
0
,
255
,
30
)
self
.
current_color
=
Color
(
0
,
255
,
30
-
self
.
pow_time
/
10000
)
else
:
self
.
current_color
.
green
+=
self
.
current_rand
self
.
current_color
.
red
=
255
self
.
current_color
.
blue
=
30
self
.
current_color
.
blue
=
30
-
(
30
*
self
.
pow_time
/
10000
)
if
self
.
pow_time
>
0
:
self
.
pow_time
-=
1
def
power
(
self
):
if
self
.
current_color
.
green
+
self
.
current_rand
>
40
:
self
.
current_rand
=
-
randint
(
1
,
8
)
self
.
current_color
=
Color
(
30
,
255
,
0
)
elif
self
.
current_color
.
green
+
self
.
current_rand
<
0
:
self
.
current_rand
=
randint
(
1
,
8
)
self
.
current_color
=
Color
(
0
,
255
,
0
)
else
:
self
.
current_color
.
green
+=
self
.
current_rand
self
.
current_color
.
red
=
255
if
self
.
pow_time
<
0
:
self
.
stato
=
0
else
:
self
.
pow_time
-=
1
self
.
pow_time
=
10000
self
.
stato
=
0
def
fade
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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