Hi guys, Ive now had the installation at http://www.hortenfyr.no up for some weeks now, and it is stable. I’m now looking into defining a XY-matrix to make better use of it.
Since it are leds running around the windows, its getting quite large for a table at 48x768px (and i might also want to take into account the space between the windows)
Are there anybody here, thats good in the math required, who can give me a hint in the right direction how to solve this.
I maybe missing something, as your mapping is very straight forward
You have to map 4 segments , and all of them are consecutive , first you have to decide where you put the 0’0 coordinate ,
Let’s say it is at 1,1,
So you will have a matrix that is 4 x 48 , for each window, then the window number can other dimension on a three dimensions array
And the coordinates translation , for each of those segments are simple multiplications and additions.
The mapping for all 16 windows will be huge, its a matrix 48x768 = 36.864 entries – where only 3008 are actual leds, the rest are just there for the mapping.
@Rasmus_Hildonen no i won’t , you should not use a matrix , that is a waste in your case ,
you have to use a “window” number , and then , a 4 dimension array ( up, right, dawn, left ) ,inside each of them you will have the segments , all with the same length , so you will use exactly the number of leds on the physical array .
@Rasmus_Hildonen you might want to re-read the comments in the link I posted.
In the method Mark suggested, you only map and store coordinates for the pixels that actually exist. If you have 2915 LEDs, you create an array with 2915 elements, and store the x axis coordinate of each LED.
The coordinate values could each be 0-255, 0-2915, etc, doesn’t really matter. You can allow for your gaps here (0,1…47,96, 97…) if you want. Repeat for the y axis. This is where I use spreadsheets and/or custom apps/scripts to generate the arrays.
Now if you want to have a vertical rainbow, you can do something like this (in a loop): leds[i] = CHSV(y[i], 255, 255).
For a horizontal rainbow, use leds[i] = CHSV(x[i], 255, 255).
For diagonal, use leds[i] = CHSV(x[i] + y[i], 255, 255)
etc.