Пример #1
0
    w1 = Worm(led, [(255, 100, 50)]*10)
    w2 = Worm(led, [(2, 100, 250)]*10)
    dim = dimLights(led)

#    animQ.addAnim(w2, fps=10, max_steps=40)
    #animQ.addAnim(dim, amt=5, fps=30, max_steps=70)
#    animQ.addAnim(w1, fps=5, max_steps = 10)
 
 
    animQ = AnimationQueue(led)
    animQ.addAnim(dim, amt=10, fps=5, max_steps=40, threaded=True)
    animQ.addAnim(w1, fps=5, max_steps=20)
    animQ.addAnim(w2, fps=5, max_steps=20)
                     
    animQ.run(untilComplete=True, max_cycles=2)
               
    
    
import bibliopixel.colors as colors
MANIFEST = [
    {
        "class": dimLights,
        "controller": "strip",
        "desc": "Changes brightness of fixed color screen",
        "display": "dimLights",
        "id": "dimLights",
        "params": [
           {
                "default": colors.Green,
                "help": "Solid Color",
Пример #2
0
        self._l_step += 1;
        #self._step += amt
        if(self._l_step >= self._level_count):
            self._l_step = 0
            self._step += amt



from stringanimation import RainbowBottomUp

anim = DNA(strip)
rainbow = [colors.Red, colors.Orange, colors.Yellow, colors.Green, colors.Blue, colors.Purple]
#anim = ColorFade(strip, rainbow, step=2)
#anim2 = ColorFade(strip, rainbow, step=40)
anim3 = RainbowBottomUp(strip)
#anim = DNAMatrix(matrix)

queue.addAnim(anim, max_steps=1180, fps=30)
queue.addAnim(anim3)

while True:

    try:
        queue.run()
    except Exception as e:
        print "problem: %s" % e
    except KeyboardInterrupt:
        #Ctrl+C will exit the animation and turn the LEDs offs
        strip.all_off()
        break
Пример #3
0
import time
from bibliopixel import *
from bibliopixel.drivers.visualizer import DriverVisualizer

driver = DriverVisualizer(width=25, height=50, pixelSize=15)
led = LEDMatrix(driver, width=0, height=0, serpentine=False, threadedUpdate=False)

from BiblioPixelAnimations.matrix.bloom import Bloom
from BiblioPixelAnimations.matrix.GameOfLife import GameOfLife
from BiblioPixelAnimations.matrix.MatrixRain import MatrixRain

from bibliopixel.animation import AnimationQueue
anim = AnimationQueue(led)

try:
    anim.addAnim(anim=Bloom(led), amt=6, fps=None, max_steps=30)
    anim.addAnim(anim=GameOfLife(led), fps=30, untilComplete=True)
    anim.addAnim(anim=MatrixRain(led), fps=30, max_steps=30*5)
    anim.run(untilComplete=False, threaded=True, fps=15)
    while not anim.stopped():
        print "Running..."
        time.sleep(1)
except:
    anim.stopThread(wait=True)
finally:
    led.all_off()
    led.update()
    print "Done!"
Пример #4
0
from bibliopixel.drivers.visualizer import Visualizer

#import AnimationQueue
from bibliopixel.animation import AnimationQueue

#import animations
from BiblioPixelAnimations.matrix.bloom import Bloom
from BiblioPixelAnimations.matrix.GameOfLife import GameOfLife
from BiblioPixelAnimations.matrix.pinwheel import Pinwheel

#load driver and controller and animation queue
driver = Visualizer(width=10, height=10, stayTop=True)
led = Matrix(driver)
anim = AnimationQueue(led)

#Load animations into Queue
bloom = Bloom(led)
#run at 15fps, for 10 seconds
anim.addAnim(bloom, amt=6, fps=15, max_steps=150)

gol = GameOfLife(led)
#run at queue default framerate, until simulation completes twice
anim.addAnim(gol, fps=None, untilComplete=True, max_cycles=2)

pin = Pinwheel(led)
#run at queue default framerate for 300 steps
anim.addAnim(pin, amt=4, fps=None, max_steps=300)

#run animations at default 30fps
anim.run(fps=30)