Skip to content
Snippets Groups Projects
Commit 7fa71c6c authored by Micah Elizabeth Scott's avatar Micah Elizabeth Scott
Browse files

Crosstalk-test: Identify strips with a binary code

parent 67b04698
No related branches found
No related tags found
No related merge requests found
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment