This is cool, and I’m pretty sure it is working like a charm for 32x8 matrix, which is “vertical-snake” connected, but on documentation page there is zero to nothing explanation in my opinion except this one example and I made 16x16 matrix, with data flow as on picture below:
I would be glad if someone could write correct pixel_mapper for my case at least, but I would be even more happy if someone would explain me how this is working and what are:
To make it more clear, in your drawing above, write down for each pixel:
Its X value (starting at 0)
Its Y value (starting at 0)
Its addressable number
and it will be clearer.
In your case, X=1, Y=14 should give and address of 17 i.e. (x * 16) + (15 - y)
Even rows (the % operator means modulus, or the remainder if an integer division) are just (x * 16) + Y, e.g. X=2, Y2 → adr = 34 (2* 8) + 2
Bottom-line: Replace 8 by 16 and 7 by 15 in the mapper above.
Your solution not worked out of box for me, cause this was also first thing I tried on my own, before I posted here. I mean, I supposed that numbers in formula should be 15 and 16 for my case, but just replacing 8 and 7 with 16 and 15, gave me mirrored text, which was scrolling from left to right by the way (it should scroll from right to left). But your explanation pushed me to turn brain on and I got what I wanted. Basically, x & y needs also to be switched.
Complete code for 16x16 matrix, with data flow direction as on picture above, should be: