def resetAndLoad(self): self.layout.setTexture( image.loadImage(self.layout, imagePath=self.imageFiles[self.imgIndex])) self.map = [(x, y) for x in range(self.width) for y in range(self.height)] shuffle(self.map)
def leddouble(self): m = MultiMapBuilder() m.addRow(mapGen(20,20,rotation=MatrixRotation.ROTATE_270),mapGen(20,20,rotation=MatrixRotation.ROTATE_270,vert_flip=True)) bibliopixel.log.setLogLevel(bibliopixel.log.DEBUG) driver1 = DriverSerial(num = 400, type = LEDTYPE.WS2811, deviceID = 1) driver2 = DriverSerial(num = 400, type = LEDTYPE.WS2811, deviceID = 2) self.led = LEDMatrix([driver2,driver1], width=40, height=20, coordMap = m.map, rotation=MatrixRotation.ROTATE_0, masterBrightness=100, pixelSize=(1,1)) texture1 = image.loadImage(self.led, "c:\\users\\ztech\\pictures\\texture2.jpg") self.led.setTexture(tex=texture1)
def ledemu(self, visw, vish, pixsize): #set log bibliopixel.log.setLogLevel(bibliopixel.log.DEBUG) #create drivervisualizer instance driver = DriverVisualizer(width=visw, height=vish, pixelSize=pixsize) #create and orient display self.led = LEDMatrix(driver, vert_flip=True) #set texture texture1 = image.loadImage(self.led, "texture2.jpg") self.led.setTexture(tex=texture1)
def ledsingle(self, visw, vish, brightness): m = MultiMapBuilder() m.addRow( mapGen(int(visw / 2), vish, rotation=MatrixRotation.ROTATE_90), mapGen(int(visw / 2), vish, rotation=MatrixRotation.ROTATE_90)) bibliopixel.log.setLogLevel(bibliopixel.log.DEBUG) driver1 = DriverSerial(num=200, type=LEDTYPE.WS2811, deviceID=3) led1 = LEDMatrix(driver1, width=20, height=10, coordMap=m.map, rotation=MatrixRotation.ROTATE_0, masterBrightness=255, pixelSize=(1, 1)) texture1 = image.loadImage(led1, "texture2.jpg") led1.setTexture(tex=texture1)
def leddouble(self, visw, vish, brightness): #create multimapbuilder instance for multiple allpixels m = MultiMapBuilder() #orient both allpixels correctly m.addRow( mapGen(int(visw / 2), vish, rotation=MatrixRotation.ROTATE_270), mapGen(int(visw / 2), vish, rotation=MatrixRotation.ROTATE_270, vert_flip=True)) bibliopixel.log.setLogLevel(bibliopixel.log.DEBUG) #instances for both allpixels driver1 = DriverSerial(num=400, type=LEDTYPE.WS2811, deviceID=1) driver2 = DriverSerial(num=400, type=LEDTYPE.WS2811, deviceID=2) #display using two drivers self.led = LEDMatrix([driver2, driver1], width=visw, height=vish, coordMap=m.map, rotation=MatrixRotation.ROTATE_0, masterBrightness=brightness, pixelSize=(1, 1)) texture1 = image.loadImage(self.led, "texture2.jpg") self.led.setTexture(tex=texture1)
led1 = LEDMatrix(driver1, width=50, height=12, coordMap=coords1, rotation=MatrixRotation.ROTATE_180, masterBrightness=250, pixelSize=(1, 1)) led2 = LEDMatrix(driver2, width=50, height=13, coordMap=coords2, rotation=MatrixRotation.ROTATE_180, masterBrightness=250, pixelSize=(1, 1)) texture1 = image.loadImage(led1, "c:\\users\\ztech\\pictures\\texture2.jpg", offset=(0, 0)) texture2 = image.loadImage(led2, "c:\\users\\ztech\\pictures\\texture2.jpg", offset=(0, -12)) led1.setTexture(tex=texture1) led2.setTexture(tex=texture2) chunk = 4096 s = pyaudio.PyAudio() sound = s.open(format=pyaudio.paInt16, channels=2, rate=44100, input=True,
def preRun(self): self._led.setTexture(loadImage(self._led, imagePath=self.img, offset=self.offset))
def ledemu(self, visw, vish): bibliopixel.log.setLogLevel(bibliopixel.log.DEBUG) driver = DriverVisualizer(width=visw, height=vish, pixelSize=10) self.led = LEDMatrix(driver, vert_flip=True) texture1 = image.loadImage(self.led, "texture2.jpg") self.led.setTexture(tex=texture1)
def preRun(self): self._led.setTexture( loadImage(self._led, imagePath=self.img, offset=self.offset))
driver2 = DriverSerial(num=650, type=LEDTYPE.WS2811, deviceID=2) led1 = LEDMatrix(driver1, width=50, height=12, coordMap=coords1, rotation=MatrixRotation.ROTATE_180, masterBrightness=250, pixelSize=(1, 1)) led2 = LEDMatrix(driver2, width=50, height=13, coordMap=coords2, rotation=MatrixRotation.ROTATE_180, masterBrightness=250, pixelSize=(1, 1)) texture1 = image.loadImage(led1, "texture2.jpg", offset=(0, 0)) texture2 = image.loadImage(led2, "texture2.jpg", offset=(0, -12)) led1.setTexture(tex=texture1) led2.setTexture(tex=texture2) chunk = 4096 s = pyaudio.PyAudio() sound = s.open(format=pyaudio.paInt16, channels=2, rate=44100, input=True, frames_per_buffer=chunk, input_device_index=2) data = sound.read(chunk) temp = [50]
import bibliopixel.image as image m = MultiMapBuilder() m.addRow(mapGen(20, 20, rotation=MatrixRotation.ROTATE_270), mapGen(20, 20, rotation=MatrixRotation.ROTATE_270, vert_flip=True)) bibliopixel.log.setLogLevel(bibliopixel.log.DEBUG) driver1 = DriverSerial(num=400, type=LEDTYPE.WS2811, deviceID=1) driver2 = DriverSerial(num=400, type=LEDTYPE.WS2811, deviceID=2) led1 = LEDMatrix([driver2, driver1], width=40, height=20, coordMap=m.map, rotation=MatrixRotation.ROTATE_0, masterBrightness=100, pixelSize=(1, 1)) texture1 = image.loadImage(led1, "texture2.jpg") led1.setTexture(tex=texture1) chunk = 4096 s = pyaudio.PyAudio() sound = s.open(format=pyaudio.paInt16, channels=2, rate=96000, input=True, frames_per_buffer=chunk, input_device_index=2) data = sound.read(chunk) temp = [40] for x in range(0, 40): temp.append(0)
from bibliopixel.drivers.serial_driver import * from bibliopixel.led import * import pyaudio import wave import numpy as np from struct import unpack from math import * import bibliopixel.image as image m = MultiMapBuilder() m.addRow(mapGen(20,20,rotation=MatrixRotation.ROTATE_270),mapGen(20,20,rotation=MatrixRotation.ROTATE_270,vert_flip=True)) bibliopixel.log.setLogLevel(bibliopixel.log.DEBUG) driver1 = DriverSerial(num = 400, type = LEDTYPE.WS2811, deviceID = 1) driver2 = DriverSerial(num = 400, type = LEDTYPE.WS2811, deviceID = 2) led1 = LEDMatrix([driver2,driver1], width=40, height=20, coordMap = m.map, rotation=MatrixRotation.ROTATE_0, masterBrightness=100, pixelSize=(1,1)) texture1 = image.loadImage(led1, "c:\\users\\ztech\\pictures\\texture2.jpg") led1.setTexture(tex=texture1) chunk = 4096 s = pyaudio.PyAudio() sound = s.open(format = pyaudio.paInt16, channels = 2, rate = 44100, input = True, frames_per_buffer = chunk, input_device_index=2) data = sound.read(chunk) temp = [40] for x in range(0,40): temp.append(0) while True: f = open("volume.txt", "r") vol = int(f.readline()) f.close()
def resetAndLoad(self): self._led.setTexture(loadImage(self._led, imagePath=self.imageFiles[self.imgIndex])) self.map = [(x,y) for x in range(self.width) for y in range(self.height)] shuffle(self.map)
def pre_run(self): self.layout.setTexture( image.loadImage(self.layout, imagePath=self.img, offset=self.offset))