Exemplo n.º 1
0
if __name__ == '__main__':
    driver = DriverVisualizer(160, pixelSize=62, stayTop=False, maxWindowWidth=1024)
    led = LEDStrip(driver, masterBrightness=255, masterBrightnessLimit=200)

    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",
Exemplo n.º 2
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!"
Exemplo n.º 3
0
#!/usr/bin/env python

from looped import create_led
from BiblioPixelAnimations.strip import Rainbows, LarsonScanners, Wave, \
    PixelPingPong, Alternates, ColorChase, ColorPattern, ColorWipe, \
    FireFlies, HalvesRainbow, PartyMode, Searchlights, WhiteTwinkle
from bibliopixel.animation import AnimationQueue
from bibliopixel import colors
import sys

led = create_led(dev=len(sys.argv) > 1 and sys.argv[1] == 'test')
queue = AnimationQueue(led)
queue.addAnim(WhiteTwinkle.WhiteTwinkle(led), fps=20, max_steps=200)
queue.addAnim(Searchlights.Searchlights(led), fps=50, max_steps=550)
queue.addAnim(PartyMode.PartyMode(led, PartyMode.rainbow), fps=15, max_steps=50)
queue.addAnim(HalvesRainbow.HalvesRainbow(led), fps=50, max_steps=150)
queue.addAnim(FireFlies.FireFlies(led, FireFlies.rainbow), fps=20, max_steps=100)
queue.addAnim(ColorWipe.ColorWipe(led, colors.Red), fps=40, max_steps=150)
queue.addAnim(ColorPattern.ColorPattern(led, ColorPattern.rainbow, 3), fps=40, max_steps=150)
queue.addAnim(ColorChase.ColorChase(led, colors.Blue), fps=40, max_steps=150)
queue.addAnim(Alternates.Alternates(led), fps=5, max_steps=20)
queue.addAnim(PixelPingPong.PixelPingPong(led, color=colors.White, max_led=led.numLEDs, total_pixels=2, fade_delay=4), fps=40, max_steps=150)
queue.addAnim(Wave.WaveMove(led, colors.White, cycles=10), fps=40, max_steps=150)
queue.addAnim(Wave.Wave(led, colors.White, cycles=10), fps=40, max_steps=150)
queue.addAnim(LarsonScanners.LarsonRainbow(led), fps=40, max_steps=150)
queue.addAnim(LarsonScanners.LarsonScanner(led, colors.White), fps=40, max_steps=150)
queue.addAnim(Rainbows.RainbowCycle(led), fps=40, max_steps=150)
# queue.addAnim(JumpIntro(led), untilComplete=True, max_steps=150)
# queue.addAnim(JumpGame(led, gamepad, ['1', '2']), fps=40)
queue.run()
Exemplo n.º 4
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
Exemplo n.º 5
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)