Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Hacksaar
Sphinx
Commits
ca45cafb
Commit
ca45cafb
authored
Nov 19, 2014
by
Constantin
Browse files
Blinker does all GPIO actions in ledactor.py
parent
006a3aa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
ledactor.py
View file @
ca45cafb
...
...
@@ -6,6 +6,7 @@ import signal
class
Blinker
(
threading
.
Thread
):
def
__init__
(
self
,
name
,
pin
,
pattern
=
[(
False
,
60.0
)]):
GPIO
.
setup
(
pin
,
GPIO
.
OUT
)
super
().
__init__
()
self
.
_name
=
name
self
.
_pin
=
pin
...
...
@@ -55,8 +56,6 @@ class LedActor:
self
.
_threads
=
{}
for
(
name
,
pin
)
in
self
.
ledPins
.
items
():
logger
.
debug
(
"Setting pin %d to output as
\"
%s
\"
LED, initial state: False"
%
(
pin
,
name
))
GPIO
.
setup
(
pin
,
GPIO
.
OUT
)
GPIO
.
output
(
pin
,
False
)
self
.
_threads
[
name
]
=
Blinker
(
name
,
pin
)
self
.
_threads
[
name
].
start
()
...
...
Write
Preview
Supports
Markdown
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