-
Notifications
You must be signed in to change notification settings - Fork 0
Multiple Driver Support
As of v1.1.0, BiblioPixel supports multiple separate output drivers to be used with a single LEDStrip or LEDMatrix instance. This allows multiple displays to be treated as on single, larger display. For example, the AllPixel can handle a maximum of 700 pixels. Two AllPixel boards could be used, each driving half of a 1400 pixel display. But in BiblioPixel, each pixel can be addressed as if it were a single display with only one driver. See multi_matrix_demo.py for an example of how this can be used.
Note, however, that using multiple drivers as a single display with LEDMatrix requires some more advanced coordinate mapping that cannot be handled automatically as it depends on the physical layout of the display. See more details in the MultiMapBuilder and mapGen section.
To take advantage of this feature, each AllPixel needs to be assigned a DeviceID. See the DeviceID section for info on how to use the DeviceIDManager script.
When using LEDStrip, it's simple. If you have two lengths of LEDs, each with 100 pixels, and each hooked up to their own driver, the second strand would be addressed at an offset of 100, instead of starting back at 0. For example:
from bibliopixel.led import *
from bibliopixel.drivers.serial_driver import *
import bibliopixel.colors as colors
driverA = DriverSerial(LEDTYPE.LPD8806, 100, deviceID = 1)
driverB = DriverSerial(LEDTYPE.LPD8806, 100, deviceID = 2)
led = LEDStrip(200, [driverA, driverB])
for i in range(200):
led.fill(colors.Red, 0, i)
led.update()
The above example would fill up the strip one at a time, across both of the 100 pixel sections. The index of the first pixel on the first section is 0, but the index of the first pixel on the second section is 100, because the first section has 100 pixels.