Maniacal Labs User Forum
Matrix dots made of multiple leds - Printable Version

+- Maniacal Labs User Forum (
+-- Forum: BiblioPixel (
+--- Forum: General Discussion (
+--- Thread: Matrix dots made of multiple leds (/showthread.php?tid=67)

Matrix dots made of multiple leds - madar - 10-09-2015


I'm not sure if this has been discussed previously. I'm search in the doc and examples a way to do it, but I haven't found it.

I need to setup a matrix (APA102) of 4x4. But every slot is made of 5 leds to have more power. You can imagine a dice face on number 5 :

Each line in my matrix looks like :


They are wired by slot, hopefully Smile Basically, I just need to repeat the same information 5 times to have all the leds of a slot displaying the same information.

Is there a way to configure the driver natively to support this layout ? If not, can you give me a clue on how to modify the driver ?

I hope I've been clear enough Smile

Thanks for your help, and thanks for the lib. It's great !

RE: Matrix dots made of multiple leds - Adam - 10-09-2015

Hmmmm... I totally see what you want to do and that would be a really interesting feature. But, sadly, no... there's no way to do that natively.

Are you using LEDStrip or LEDMatrix?

There's a couple ways it could be done... and through the beauty of python, I think you could make it work with code that lives outside of BiblioPixel... meaning you don't have to actually modify the core library (something i really don't suggest so that you can still update when a new version is released).

Either way, I definitely don't recommend modifying the driver... it won't solve your problem. You need to modify the controller... which is LEDStrip or LEDMatrix, because the driver still needs to output the correct number of pixels.

It's certainly doable... just depends on what controller you are using. Let me know and I'll figure something out. BiblioPixel 2.0 is coming out soon and it would be a great new feature... especially for LEDStrip. LEDMatrix is going to be REALLY confusion to do... to many variables.

RE: Matrix dots made of multiple leds - madar - 10-12-2015


Thank you for your answer. I'll handle it on highest level Smile I'm using my own PCB for this project.
I hope you'll add this feature in next version, this could be handy.


RE: Matrix dots made of multiple leds - Adam - 10-12-2015

Already working on it Smile Shouldn't be too big of a problem.

RE: Matrix dots made of multiple leds - Adam - 10-13-2015

Done. Check out the dev branch if you want to see it:
I'm going to be releasing v2.0 very soon and it will be in that.
Basically, now you can do this:

driver = DriverAPA102(num=10*10) #use actual pixel count
led = LEDMatrix(width=10, height=10, pixelSize=(5,5)) #use actual pixel count but specify logical pixelSize

This would give you basically a 2x2 display since (10,10) / (5,5) = (2,2)
pixelSize must divide evenly into the actual display size. But now you can use all your usual set functions with the scaled coordinates, and it will auto fill the larger pixels.

LEDStrip has a similar implementation but the parameter is pixelWidth since it's a single value, not a tuple.

RE: Matrix dots made of multiple leds - josh38 - 03-13-2016

There is no way to control BOTH APA102 strips AND dmx PAR cans with one controller running from Madmapper. 

RE: Matrix dots made of multiple leds - jack - 12-22-2016

I'm trying to use this pixel size feature in PixelWeb.
Firstly it gave me exception that float is passed instead of int to range() function (even though things divided properly). I'm completely new to Python, but I believe int divided by int results in float type. So I decided that problem lies in division and wrapped 3 appropriate PixelSize related divisions with int() in LEDStrip and LEDMatrix. This solved the exception, however default animations doesn't seem to work properly, e.g. I see only half of bloom animation on half of the physical matrix, the other half remains dark.
My configuration is 28 columns and 18 rows; pixel width is 2 and height is 1. Total of 504 leds. PiWS281X driver.
Any ideas/suggestions if I'm missing something?

RE: Matrix dots made of multiple leds - Adam - 12-22-2016

Can you show your code? Not quite sure what you are going for...

RE: Matrix dots made of multiple leds - jack - 12-24-2016

Here is what I did:
  • Installed PixelWeb using pip on freshly installed RPi2B
  • Started PixelWeb
  • Configured output
    • Driver WS281X (Visualizer works the same) #Pixels: 504
    • Controller LEDMatrix. Width 28 Height 18. Advanced Pixel Size Width 2 Height 1
  • Start Bloom animation
    • It gives me ERROR - status - Failure starting animation: range() integer end argument expected, got float.
I wanted a quick fix and had a brief look at the existing code. I believe the float type appears here

So I modified that code to be:
self.width = int(self.width / pw)
self.height = int(self.height / ph)
It solved exception, but when I run Bloom animation it fills only left half of the screen. Some other animations also behave strange.

Same exception happened with LEDStrip controller. And after applying same int() fix here ColorWipe animation doesn't fill last pixel.

My screen consists of cells, each of which has 2 leds in it for brightness, so pixel size seems exactly what I'd need.