Thanks to a generous donation from Martin Welford (@viking), I’m happy to say that the teensylc
branch now has support for panels with non-linear pixel mapping, including multi-row-mapping, like the 1/4 scan panels mentioned above. I added this support to both the ESP32 and Teensy on that branch. Adding support for new panels requires some code changes, but it’s mostly copy/paste and modifying numbers, not actual coding from scratch, so it’s accessible to more people.
There’s documentation in the teensylc branch README, and in the new MultiRowRefreshMapping
sketch. The basics are:
- If you want to support a new panel, you run the MultiRowRefreshMapping sketch, and draw out a map of how the pixels on the first address are mapped (usually across multiple rows)
- You can then turn the map into a table that gets added to the SmartMatrix Library
- You define a new
panelType
that uses the new map
- Use the new panelType in your sketch
Here’s an example of a map for my 32x16/2 panel. Note that some pixels are filled from left to right, and some right to left.
And here’s the table that corresponds with the sketch:
const PanelMappingEntry panelMap32x16Mod2[] =
{
{0, 71, -8},
{0, 87, -8},
{0, 103, -8},
{0, 119, -8},
{2, 72, 8},
{2, 88, 8},
{2, 104, 8},
{2, 120, 8},
{4, 7, -8},
{4, 23, -8},
{4, 39, -8},
{4, 55, -8},
{6, 8, 8},
{6, 24, 8},
{6, 40, 8},
{6, 56, 8},
{0, 0, 0} // last entry is all zeros
};
I’ve added support for a few panels that I have here, and the one that @viking needed. Some panels with the same dimensions and scan type have different mappings, so it’s not as simple as just picking your panelType from a list. You can run the MultiRowRefreshMapping sketch in a TESTING mode that can be used to test to see if the panel you have matches an existing mapping in the library.
While I was at it, I added initial support for HUB12 panels, a type of low cost panel that has a single mono color channel (instead of a pair of RGB color channels like HUB75). You can find these in P10 32x16 sizes for $7 or less on Aliexpress. SmartMatrix Library doesn’t handle them efficiently right now, as you need to pretend the panel is twice the size it is to handle the unused second RGB channel, and the panel only needs a single color instead of RGB.
Unfortunately I’m not going to back port the multi-row-mapping feature into the released version of SmartMatrix Library. There was a ton of refactoring done on the teensylc branch that made adding this feature possible. The Teensy portion of the teensylc branch seems to be pretty stable, so eventually that refactored code may make it into a SmartMatrix Library release, but not anytime soon.
If you give this a try, please let me know what you think, or if you have any issues. If mapping isn’t working for you, please record a video of the MultiRowRefreshMapping running through a full loop, as that can be really useful to help troubleshoot or to make a map.