Ejemplo n.º 1
0
def main(parseOpts = False, looplimit=10):
    numLEDs = 512
    client = pattern_utils.connectToServer()


    t = 0

    for i in range(looplimit):
        t += 0.4
        brightness = int(min(1, 1.25 + math.sin(t)) * 255)
        frame = [ (brightness, brightness, brightness) ] * numLEDs
        client.put_pixels(frame)
        time.sleep(0.05)
Ejemplo n.º 2
0
def main(parseOpts=False, looplimit=10):
    print '    sending pixels forever (control-c to exit)...'
    print
    coordinates = utils.getCoordinates(utils.layoutFile)
    client = utils.connectToServer()

    n_pixels = utils.strip_length * utils.n_strips
    random_values = [random.random() for ii in range(n_pixels)]
    start_time = time.time()
    for sec in range(looplimit * utils.fps):
        t = time.time() - start_time
        pixels = [pixel_color(t * 0.6, coord, ii, n_pixels, random_values) for ii, coord in enumerate(coordinates)]
        client.put_pixels(pixels, channel=0)
        time.sleep(1 / utils.fps)
Ejemplo n.º 3
0
def main(parseOpts=False, looplimit=10):
    coordinates = utils.getCoordinates("/home/pi/bm2015.json")

    client = utils.connectToServer()

    print "    sending pixels forever (control-c to exit)..."
    print

    n_pixels = utils.strip_length * utils.n_strips
    start_time = time.time()
    for i in range(looplimit * utils.fps):
        t = time.time() - start_time
        pixels = [pixel_color(t, coord, ii, n_pixels) for ii, coord in enumerate(coordinates)]
        client.put_pixels(pixels, channel=0)
        time.sleep(1 / utils.fps)
Ejemplo n.º 4
0
#!/usr/bin/env python

# Light each LED in sequence, and repeat.

import opc, time

import pattern_utils

numLEDs = 512
client = pattern_utils.connectToServer()

while True:
    for i in range(numLEDs):
        pixels = [(0, 0, 0)] * numLEDs
        pixels[i] = (255, 255, 255)
        client.put_pixels(pixels)
        time.sleep(0.01)