FastLed Matrix with nonlinear led array

340 Views Asked by At

I built this LED lamp project where i put 126 ping pong balls with ws2812B leds inside, into a glass vase. I had no previous knowledge of fastled prior to this. The balls are all jumbled up and leds are in no apparent sequence any longer. In the code I created a 3d array where I assigned each led a position in the matrix by taping a grid on the outside of the vase and selecting each led with a built in potentiometer and reading the led number from the serial monitor. so I now have this 3d array

int led_zyx[3][7][13] =
{
  { {92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92},
    {92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92},
    {78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78},
    {65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65},
    {40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40},
    {24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24},
    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
  },
  {
    {124, 124, 124, 124, 110, 119, 119, 116, 116, 108, 108, 108, 117},
    {92, 89, 89, 107, 104, 104, 110, 116, 105, 108, 108, 106, 106},
    {85, 84, 84, 77, 98, 82, 97, 97, 75, 92, 91, 85, 85},
    {34, 73, 73, 60, 60, 82, 65, 65, 45, 62, 72, 34, 34},
    {38, 32, 50, 46, 47, 40, 51, 40, 29, 29, 38, 38, 38},
    {0, 17, 17, 46, 25, 25, 31, 31, 10, 29, 23, 23, 23},
    {2, 2, 0, 0, 0, 1, 1, 0, 0, 10, 2, 2, 2}
  },
  {
    {113, 118, 114, 109, 125, 115, 121, 120, 120, 123, 112, 112, 117},
    {95, 89, 103, 83, 83, 99, 100, 122, 111, 101, 96, 106, 102},
    {84, 94, 81, 80, 83, 88, 79, 70, 87, 86, 96, 90, 93},
    {74, 67, 55, 68, 76, 56, 69, 57, 61, 71, 58, 63, 74},
    {54, 49, 26, 37, 42, 41, 36, 43, 52, 44, 33, 59, 66},
    {18, 19, 13, 20, 25, 25, 21, 30, 22, 35, 39, 33, 27},
    {14, 8, 3, 9, 4, 4, 12, 16, 5, 11, 15, 28, 7}
  },
}; 

So i already managed to create of all kinds of cool modes like that - except of using the outside of the lamp/vase as an XY matrix to draw animations on it. It would be a comfortable 13x7 pixels to play around with, but I cant quite figure out how to address it properly to display graphics, or text or pixel animations.

Could anyone give me a pointer how to approach this? I looked into XYmatris and smartmatrix, but they require the leds to be layed out in a specific order - not in that random way mine are set up.

Thank you for your help

0

There are 0 best solutions below