Exactly how it is wired up?

There are many ways of wiring it up and each one requires slightly different software.

For example this is a 7 by 7 column raster that starts at the bottom left corner and goes up.

You could wire it from the top right and go down, or the top right go down and move from right to left, or the bottom right, go up and move from right to left. That is the four ways you could wire it.

If you have a row raster then there are four ways to wire that up as well.

To do any sort of intelligent plotting on this sort of thing you need a function that takes in the X-Y coordinates of your matrix and converts it into an LED number.

For this way of wiring it up the conversion from X - Y values to strip values are just a little more involved but that what software is for. In the case of even numbered columns the conversion is simply what we had before, with:-

LED number = Y + (X * number of LEDs in a column)

However for odd numbered columns the conversion is :-

LED number = (X * number of LEDs in a column) + (number of LEDs in a column -1 -Y)

To determine if the X coordinate is odd or even, simply look at the least significant bit of the X value and if it is a zero then it is an even column or if it is a one it is an odd column. So all the software has to do is to examine the X - coordinate and decide what formula to use. It is simple enough to make a function that returns the LED number given the X & Y values.

`int getLEDpos(int x, int y){ // for a serpentine raster`

int pos;

if(x & 0x1) { // is X odd

pos = x * yMax + (yMax -1 - y) ;

} else { // x is even

pos = x * yMax + y;

}

return pos;

}

Where yMax is the number of LEDs in a column.