Hey y’all!
I’m trying to figure out how to best approach rendering animations on both 1D & 2D effects to account for physical gaps between multiple matrices.
Example Setup:
- 6 Panels each with 8Wx32H RGB LEDs.
- Serpentine Layout
PANEL 1 (DIN >> 0, DOUT>> 255)
0 1 2 3 4 5 6 7
15 14 13 12 11 10 9 8
PANEL 2 (DIN>>256, DOUT>> 511)
256 257 258 259 260 261 262 263
271 270 269 268 267 266 265 264
ETC…
The panels have a physical gap between them (~3-4 inches). Currently, animations will immediately jump from virtual x column 7 to virtual x column 8 on next panel immediately and I’m trying to account for that gap/offset in physical space.
I’ve thought about fiddling with custom mapping but I am unsure if that would work for “hidden pixels” or using logic similar to some FastLED approach with irregular/gapped LED arrays along the lines of the code below:
/ Params for width and height
const uint8_t kMatrixWidth = 8;
const uint8_t kMatrixHeight = 32;
#define NUM_LEDS (kMatrixWidth * kMatrixHeight)
CRGB leds[ NUM_LEDS ];
#define LAST_VISIBLE_LED 255
uint8_t XY (uint8_t x, uint8_t y) {
// any out of bounds address maps to the first hidden pixel
if ( (x >= kMatrixWidth) || (y >= kMatrixHeight) ) {
return (LAST_VISIBLE_LED + 1);
}
const uint8_t XYTable[] = {
255, 254, 253, 252, 251, 250, 249, 248,
240, 241, 242, 243, 244, 245, 246, 247,
239, 238, 237, 236, 235, 234, 233, 232,
224, 225, 226, 227, 228, 229, 230, 231,
223, 222, 221, 220, 219, 218, 217, 216,
208, 209, 210, 211, 212, 213, 214, 215,
207, 206, 205, 204, 203, 202, 201, 200,
192, 193, 194, 195, 196, 197, 198, 199,
191, 190, 189, 188, 187, 186, 185, 184,
176, 177, 178, 179, 180, 181, 182, 183,
175, 174, 173, 172, 171, 170, 169, 168,
160, 161, 162, 163, 164, 165, 166, 167,
159, 158, 157, 156, 155, 154, 153, 152,
144, 145, 146, 147, 148, 149, 150, 151,
143, 142, 141, 140, 139, 138, 137, 136,
128, 129, 130, 131, 132, 133, 134, 135,
127, 126, 125, 124, 123, 122, 121, 120,
112, 113, 114, 115, 116, 117, 118, 119,
111, 110, 109, 108, 107, 106, 105, 104,
96, 97, 98, 99, 100, 101, 102, 103,
95, 94, 93, 92, 91, 90, 89, 88,
80, 81, 82, 83, 84, 85, 86, 87,
79, 78, 77, 76, 75, 74, 73, 72,
64, 65, 66, 67, 68, 69, 70, 71,
63, 62, 61, 60, 59, 58, 57, 56,
48, 49, 50, 51, 52, 53, 54, 55,
47, 46, 45, 44, 43, 42, 41, 40,
32, 33, 34, 35, 36, 37, 38, 39,
31, 30, 29, 28, 27, 26, 25, 24,
16, 17, 18, 19, 20, 21, 22, 23,
15, 14, 13, 12, 11, 10, 9, 8,
0, 1, 2, 3, 4, 5, 6, 7
};
uint8_t i = (y * kMatrixWidth) + x;
uint8_t j = XYTable[i];
return j;
}
Hope that makes sense! ![]()
Thanks!