Ejemplo n.º 1
0
from bibliopixel.wormanimclass import pathgen
# set up led with it's driver for the MasterAnimation
try:  # to use visualizer but if fails
    drivermaster = DriverVisualizer(160,
                                    pixelSize=62,
                                    stayTop=False,
                                    maxWindowWidth=1024)
    ledmaster = LEDMatrix(drivermaster,
                          width=16,
                          height=10,
                          threadedUpdate=False)
except:
    # assume on my pi and connect to strip, however a process of visualizerUI.py will have
    # been started and will fail
    drivermaster = DriverLPD8806(160)
    ledmaster = LEDMatrix(drivermaster,
                          width=16,
                          height=10,
                          threadedUpdate=False)

# Set up animations that will run concurrently
# Wave arguments
waveblue = ((0, 0, 255), 1)
wavered = ((0, 255, 0), 1)
wavegreen = ((255, 0, 0), 1)
wavecyan = ((255, 0, 255), 1)
wavewhite = ((255, 255, 255), 1)

# Wave slave driver arguments
wavebluepixmap = pathgen(1, 15, 0, 9)
Ejemplo n.º 2
0
#Load driver for your hardware, visualizer just for example
from bibliopixel.drivers.LPD8806 import DriverLPD8806
driver = DriverLPD8806(num=32)

#load the LEDStrip class
from bibliopixel.led import *
led = LEDStrip(driver)

#load channel test animation
from scanner import *
#anim = LarsonScanner(led, 6, red)
anim = LarsonRainbow(led, 25)
try:
    anim.run()
except KeyboardInterrupt:
    led.all_off()
    led.update()
Ejemplo n.º 3
0
#constant
COL0 		= 0
COL1 		= 56
COL2 		= 63
COL3 		= 118
COL4 		= 125
decay 		= .75
MAX_HEIGHT 	= 25
LED_STRIP_LEN 	= 160

from random import randint
import time

#Load driver for your hardware, visualizer just for example
from bibliopixel.drivers.LPD8806 import DriverLPD8806
driver = DriverLPD8806(num = LED_STRIP_LEN)

#load the LEDStrip class
from bibliopixel.led import *
led = LEDStrip(driver)

#load some cool shit right her'
from strip_animations import *
#anim = Rainbow(led)

from bibliopixel.colors import *
mycolors = [colors.Red, colors.Orange, colors.Yellow, colors.Green, colors.PapayaWhip, colors.Blue, colors.Purple, colors.Pink, colors.Honeydew, colors.Chocolate,
		colors.NavajoWhite, colors.Olive, colors.DarkSalmon, colors.IndianRed, colors.Navy, colors.SeaGreen]

#anim = Rainbow(led)
#anim = FireFlies(led, mycolors) 
Ejemplo n.º 4
0
thanksgiving = [(00,102,51), (00,204,153), (00,204,102)]

class Kitt(BaseStripAnim):
    def __init__(self, led):
        super(Kitt, self).__init__(led)
        self.length = 32*5

    def step(self, amt=1):
        middle = self.length / 2
        self._led.set(middle, orange)
        self._step += amt

speed = 0.001
speed = 16.0
led = LEDStrip(DriverLPD8806(32*5, dev="/dev/spidev0.0", SPISpeed=speed))
#anim = StripTest(led)
#anim = Halloween1(led)

from strip_animations import *
anim = RainbowCycle(led)
#anim = ColorPattern(led, [purple, orange], 10)
#anim = ColorPattern(led, thanksgiving, 32)
anim = ColorFade(led, [blue], 2) # maybe?
#anim = ColorFade(led, thanksgiving, 3)
#anim = ColorChase(led, orange, 10)
anim = FireFlies(led, [blue, red], width=3, count=2)
#anim = LarsonScanner(led, blue, 10) # cat toy
#anim = LarsonScanner(led, orange, 10) # cat toy
#anim = Kitt(led)
#anim = LarsonRainbow(led)
Ejemplo n.º 5
0
import random
from struct import unpack
import sys
import time
import wave

import alsaaudio as aa
import configuration_manager as cm
import decoder
import hardware_controller as hc
import numpy as np

from bibliopixel.colors import *

from bibliopixel.drivers.LPD8806 import DriverLPD8806
driver = DriverLPD8806(num = 160)

#load the LEDStrip class
from bibliopixel.led import *
led = LEDStrip(driver)
led.all_off()

led_array = [0 for i in range(151)]

c = 0.0
columns = [1.0,1.0,1.0,1.0,1.0]
decay = .9
# this writes out light and color information to a continuous RGB LED
# strip that's been wrapped around into 5 columns.
# numbers comes in at 9-15 ish
def display_column(col=0,height=0.0,color=colors.Blue):
Ejemplo n.º 6
0
import sys
import time

from bibliopixel import LEDStrip
from bibliopixel.drivers.driver_base import ChannelOrder
from bibliopixel.drivers.LPD8806 import DriverLPD8806

from loader import load
from matrix_animator import MatrixAnimator


FILENAME = 'first.bw'

driver = DriverLPD8806(num=32, c_order=ChannelOrder.BRG)
strip = LEDStrip(driver)


def main(filename):
    
    animator = MatrixAnimator(strip, load(filename), False)
    animator.run(threaded=True)
    return animator

if __name__ == '__main__':
    if len(sys.argv) == 1:
        main(FILENAME)
    else:
        main(sys.argv[1])

    print('Press enter to finish the program')
    raw_input()