Ok, Next problem!
With a strip of leds, arranged back and forth into a 6 x 4 matrix, how do i get my head around converting this into a more useable 0,0 bottom left and 6,4 top right?
You will have to write a routine that will read through your two-dimensional array in the correct order to write to the one-dimensional strip array.
You’re a version ahead in the library roadmap! I’m building out some classes for describing led arrangements so you can access the less how you want - and they will map behind the scenes to the correct pixel for the led strip.
In the meantime, some rough math - let’s say a row is ROWCOUNT LEDs, and y is your row and x is the led in that row:
leds[x + (y * ROWCOUNT)]
Would be the right led in a grid. However, every opposite row is backwards so ever odd numbered row is “backwards”:
if(y%2 == 1) { // row is odd
leds[(y * ROWCOUNT) + ((ROWCOUNT-1)-x)]
} else { // row is even
leds[(y*ROWCOUNT) + x]
}
At least, that’s the rough logic (I hope, typing code on a phone sucks!)