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

More tools, measuring-stick and strobe

parent 39d09765
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
# Open Pixel Control version of the "measuring_stick" Arduino sketch:
# For each group of 64 LEDs (one strip), lights all LEDs with every
# multiple of 10 lit green.
import opc, time
numStrings = 8
client = opc.Client('localhost:7890')
string = [ (128, 128, 128) ] * 64
for i in range(7):
string[10 * i] = (128, 255, 128)
# Immediately display new frame
pixels = string * numStrings
client.put_pixels(pixels)
client.put_pixels(pixels)
#!/usr/bin/env python
# Open Pixel Control client: All lights to solid white
import opc, time
numLEDs = 512
client = opc.Client('localhost:7890')
black = [ (0,0,0) ] * numLEDs
white = [ (255,255,255) ] * numLEDs
while True:
for i in range(10):
if i == 0:
client.put_pixels(white)
else:
client.put_pixels(black)
time.sleep(0.1)
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