Thread resurrection. Code help please.
I'm working on this using a sequential 256 led neopixel string which is laid out in a prebuilt 16x16 matrix panel.
The neopixel string works fine but is like a snakes and ladder board in that starting from bottom left corner you go along the bottom up at the end of the row then back along then up a row and along etc etc. (Back and forth)
This arrangement is of course different to the actual LIFE array in PIC memory which is arranged as per the diagram.
So I want to transfer data from the Life byte array into the NeoPixel byte array adjusting the NeoPixel(address) when necessary.
The diagram might make it easier to see what i mean..
Code:
'Life Array 16x16 in memory. 'Life Array 16x16 Neopixel Matrix String.
' Top Top
'240 -------------- 255 '255 -------------- 240
'224 -------------- 239 '224 -------------- 239
'208 -------------- 223 '223 -------------- 208
'192 -------------- 207 '192 -------------- 207
'176 -------------- 191 '191 -------------- 176
'160 --x----------- 175 '160 --x----------- 175
'144 ---x---------- 159 '159 ----------x--- 144
'128 -xxx---------- 143 '128 -xxx---------- 143
'112 -------------- 127 '127 -------------- 112
'96 -------------- 111 '96 -------------- 111
'80 -------------- 95 '95 -------------- 80
'64 -------------- 79 '64 -------------- 79
'48 -------------- 63 '63 -------------- 48
'32 -------------- 47 '32 -------------- 47
'16 -------------- 31 '31 -------------- 16
'0 -------------- 15 '0 -------------- 15
' Bottom Bottom
Hopefully you see the problem, I can't see an efficient way to transfer the data from the LIFE to the NEOPIXEL array whilst correcting the address on the alternate lines..
A simple Pixel(A) = Life(A) works for 0-15, 32-47 etc etc but not for 16-31, or 48-63 etc etc as the data ends up on the wrong part of the screen..
Any brilliant ideas.
You can see the problem on 144-159 with test data, it ends up on the wrong part of the screen.
Bookmarks