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
Chris
Pixelframe
Commits
0722ae0e
Commit
0722ae0e
authored
Dec 15, 2020
by
Christian Wander
Browse files
initial commit
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
dmxfun.py
0 → 100644
View file @
0722ae0e
import
sacn
import
time
count
=
144
def
main
():
print
(
">> Hello, doing fancy python stuff."
)
universe
=
1
;
sender
=
sacn
.
sACNsender
()
sender
.
start
()
sender
.
activate_output
(
universe
)
# sender[1].multicast = True
sender
[
universe
].
destination
=
"192.168.178.37"
pink
=
(
255
,
0
,
255
)
lightblue
=
(
0
,
255
,
255
)
blue
=
(
0
,
0
,
255
)
# mode 4 Multiple RGB ('led0 red', 'led0 green', 'led0 blue', 'led1 red', ...)
# sender[universe].dmx_data = (255, 0, 255, 0, 255, 255, 0, 0, 255) ## some test DMX data
# sender[universe].dmx_data = pink + lightblue + blue
sender
[
universe
].
dmx_data
=
gimme
(
blue
)
# pink = (128, 128, 0, 128)
# sender[universe].dmx_data = (128, 128, 128, 0)
# sender[universe].dmx_data = (5, 6, 7, 8)
time
.
sleep
(
10
)
## stopping the sender?!
sender
.
stop
()
def
gimme
(
color
):
result
=
[
0
]
*
count
*
3
i
=
0
;
while
i
<=
count
*
3
-
3
:
result
[
i
]
=
color
[
0
]
result
[
i
+
1
]
=
color
[
1
]
result
[
i
+
2
]
=
color
[
2
]
i
=
i
+
3
return
result
;
if
__name__
==
"__main__"
:
main
()
\ No newline at end of file
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