Ejemplo n.º 1
0
    args = parser.parse_args()

    if args.display == 'full':
        w = 140
        h = 140
        driver = DriverPieva(width=w, height=h)
    else:
        w = 70
        h = 70
        if args.display == 'x4':
            driver = DriverPievaX4(width=w, height=h)
        else:
            driver = DriverPievaX4Rev(width=w, height=h)

    led = LEDMatrix(driver, width=w, height=h, serpentine=False)
    led.setMasterBrightness(255)

    if args.recorder == 'alsa':
        recorder = AlsaRecorder()
    else:
        recorder = PyAudioRecorder()

    if args.anim == 'eq':
        anim = EQ(recorder, led, args.min_freq, args.max_freq, args.sensitivity)
    elif args.anim == 'bass':
        anim = BassPulse(recorder, led, args.min_freq, args.max_freq, args.sensitivity)
    else:
        from bibliopixel.animation import MatrixCalibrationTest, MatrixChannelTest
        anim = MatrixCalibrationTest(led)

    print driver, led, anim
Ejemplo n.º 2
0
        # x = 0
        # for y in eq_data:
        #     self._led.drawLine(x, self._led.height - 1, x, self._led.height - int(y), colors.hue_helper(int(y), self._led.height, 0))
        #     x += 1
        self._step = amt
            
#Load driver for your hardware, visualizer just for example
# from bibliopixel.drivers.visualizer import DriverVisualizer
# driver = DriverVisualizer(width = 24, height = 24, stayTop = True)

from bibliopixel.drivers.serial_driver import *
import bibliopixel.gamma as gamma
num = 24*24
print "Pixel Count: {}".format(num)
driver = DriverSerial(LEDTYPE.LPD8806, num, c_order=ChannelOrder.BRG, SPISpeed=2, gamma = gamma.LPD8806)

#load the LEDMatrix class
from bibliopixel.led import *
#change rotation and vert_flip as needed by your display
led = LEDMatrix(driver, rotation = MatrixRotation.ROTATE_0, vert_flip = True)
led.setMasterBrightness(128)
import bibliopixel.log as log
#log.setLogLevel(log.DEBUG)

try:
    anim = EQ(led)
    anim.run(fps=30)
except KeyboardInterrupt:
    anim.endRecord()
    led.all_off()
    led.update()