示例#1
0
        if bits < 1 or bits > 11:
            raise ValueError("PWM level must be between 1 and 11")
        # self._matrix.SetPWMBits(bits)

        self.options.pwm_bits = bits
        self._matrix = RGBMatrix(options = self.options)

        
        

from bibliopixel.layout import *
from bibliopixel.animation import MatrixCalibrationTest
from bibliopixel.drivers.SPI.LPD8806 import *
from bibliopixel.layout import Rotation


#create driver for a 12x12 grid, use the size of your display
driver = DriverAdaMatrix()
led = Matrix(driver)

anim = MatrixCalibrationTest(led)

anim.run()







from bibliopixel.drivers.network import DriverNetwork
from bibliopixel.led import LEDMatrix
from matrix_animations import *
from bibliopixel import *
log.setLogLevel(log.DEBUG)

#must init with same number of pixels as receiver
w = 32	
h = 32
driver = DriverNetwork(w*h, port=1618)
led = LEDMatrix(driver, width=w, height=h, vert_flip=False, serpentine=False, threadedUpdate=False)

from bibliopixel.animation import MatrixCalibrationTest
anim = MatrixCalibrationTest(led)
try:
	anim = Bloom(led, dir=True)
	anim.run(amt=6)#, fps = 60)
except KeyboardInterrupt:
	led.all_off()
	led.update()
#Load driver for your hardware, visualizer just for example
from bibliopixel.drivers.visualizer import DriverVisualizer
driver = DriverVisualizer(width = 10, height = 10, stayTop = True)

#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 = False)

#load calibration test animation
from bibliopixel.animation import MatrixCalibrationTest
anim = MatrixCalibrationTest(led)

try:
	anim.run()
except KeyboardInterrupt:
	led.all_off()
	led.update()
from bibliopixel import *
#log.setLogLevel(log.DEBUG)

#Load driver for your hardware, visualizer just for example
from bibliopixel.drivers.visualizer import DriverVisualizer
driver = DriverVisualizer(width = 10, height = 10, stayTop = True)

#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 = False)

#load calibration test animation
from bibliopixel.animation import MatrixCalibrationTest
anim = MatrixCalibrationTest(led)

try:
	anim.run(max_steps=10, threaded=True, joinThread=False)

	raw_input("Any key to stop...")

	anim.stopThread(True)

	raw_input(">>")
except KeyboardInterrupt:
	pass

led.all_off()
led.update()