Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Fadecandy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scanlime
Fadecandy
Commits
7fa71c6c
Commit
7fa71c6c
authored
11 years ago
by
Micah Elizabeth Scott
Browse files
Options
Downloads
Patches
Plain Diff
Crosstalk-test: Identify strips with a binary code
parent
67b04698
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
tools/crosstalk-test.py
+13
-0
13 additions, 0 deletions
tools/crosstalk-test.py
with
13 additions
and
0 deletions
tools/crosstalk-test.py
+
13
−
0
View file @
7fa71c6c
...
...
@@ -3,16 +3,29 @@
# Open Pixel Control client: Test crosstalk between LED strips;
# send each strip a different pattern, use a lot of low-brightness
# pixels so that glitches show up clearly.
#
# This also helps identify strips. The first three LEDs are colored
# according to the strip number, in binary: MSB first, bright green
# for 1 and dim red for 0.
import
opc
,
time
client
=
opc
.
Client
(
'
localhost:7890
'
)
bits
=
(
(
40
,
0
,
0
),
(
0
,
255
,
0
)
)
while
True
:
# Flash each strip in turn
for
strip
in
range
(
8
):
pixels
=
[
(
40
,
40
,
40
)
]
*
512
for
i
in
range
(
32
):
pixels
[
strip
*
64
+
i
*
2
]
=
(
100
,
100
,
100
)
# Label all strips always
for
s
in
range
(
8
):
pixels
[
s
*
64
+
0
]
=
bits
[(
s
>>
2
)
&
1
]
pixels
[
s
*
64
+
1
]
=
bits
[(
s
>>
1
)
&
1
]
pixels
[
s
*
64
+
2
]
=
bits
[(
s
>>
0
)
&
1
]
client
.
put_pixels
(
pixels
)
time
.
sleep
(
0.5
)
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