0

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

Bravewart
  • 17
  • 7
  • Why do they need to be random? Why not put them in there in an orderly fashion? – Delta_G Sep 30 '20 at 20:10
  • @Delta_G its kind of the nature of this particular beast. The goal was to have a glass vase filled with pp-balls. That is a naturally random thing by itself. To use it as a "display" would be a nice bonus effect and a good way for me to continue exploring coding with fastled. I cannot post a picture here, right? It would kind of help explaining the challenge – Bravewart Oct 01 '20 at 05:32
  • upload the picture somewhere and provide a link. I'm not sure if I understand your post. are you trying to get that random pile of balls into a coordinate grid using a look up table so the ball in the lower left front maps to pixel 0,0,0? – Piglet Oct 01 '20 at 06:25
  • @Piglet Basically - yes. I realise now this harder to explain than I thought, but here is some pics and a video: https://photos.app.goo.gl/xsFiWVQpatBiHzLd8 , https://photos.app.goo.gl/4HT4fQy6AcTcmuyp9. The outermost leds make up a grid going around the vase - making up an XY grid. Not a particularly straight grid, but hopefully straight enough to be able to try to put some content on it. – Bravewart Oct 01 '20 at 08:34
  • @Piglet pixel 0,0,0 is actually the pixel at the center bottom. the 3D array is wrapped around the center, making z0 the innermost pixels and z2 the outermost (the ones I would like to draw on). y0 - y6 is the y axis starting at the bottom. x0 - x12 is the x axis going around the perimeter. there for the pixels I would like to use for this are all z2. – Bravewart Oct 01 '20 at 11:59

0 Answers0