Example #1
0
        self._count += 1

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",
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!"
Example #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()
Example #4
0
# (3) Reverse of (1)


#causes frame timing information to be output
#bibliopixel.log.setLogLevel(bibliopixel.log.INFO)

#Driver, Strip, and Matrix
driver = DriverSerial(num=236, type=LEDTYPE.APA102)
#visualizer = DriverVisualizer(width=2, height=118)

strip = LEDStrip(driver, threadedUpdate=True, masterBrightness=150)
# matrix = LEDMatrix(driver, 
#                    width=2, 
#                    height=118,
#                    serpentine=False)
queue = AnimationQueue(strip)

#http://www.colourlovers.com/palette/1813691/Art_is_in_my_DNA
cRed = (255,0,96)
cOrange = (255,143,0)
cLime = (205,255,0)
cBlue = (35,216,216)
cGreen = (254,214,0)

def rand_color():
    #return (color_scale((randint(0,255),randint(0,255),randint(0,255)), randint(0,255)))
    return (color_scale((randint(0,255),randint(0,255),randint(0,255)), 255))

class ColorFade(BaseStripAnim):
    """Fill the dots progressively along the strip."""
Example #5
0
#import base classes and driver
from bibliopixel import *
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