And this.... is just some "reference code" and individual LED code to help me from getting all turned around. Also, I was thinking of possibly incorporating later.
....If I need to.
// Individual LED Coordinates - (x,y) - axis = corner of transistors (x) & cathodes (y)
void oneOne()
{
shiftOut(data2, clock2, LSBFIRST, B00000001);
shiftOut(data1, clock1, LSBFIRST, B00000000);
}
void oneTwo()
{
shiftOut(data2, clock2, LSBFIRST, B00000010);
shiftOut(data1, clock1, LSBFIRST, B00000000);
}
void oneThree()
{
shiftOut(data2, clock2, LSBFIRST, B00000100);
shiftOut(data1, clock1, LSBFIRST, B00000000);
}
void oneFour()
{
shiftOut(data2, clock2, LSBFIRST, B00001000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
}
void twoOne()
{
shiftOut(data2, clock2, LSBFIRST, B00010000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
}
void twoTwo()
{
shiftOut(data2, clock2, LSBFIRST, B00100000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
}
void twoThree()
{
shiftOut(data2, clock2, LSBFIRST, B01000000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
}
void twoFour()
{
shiftOut(data2, clock2, LSBFIRST, B10000000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
}
void threeOne()
{
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00000001);
}
void threeTwo()
{
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00000010);
}
void threeThree()
{
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00000100);
}
void threeFour()
{
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00001000);
}
void fourOne()
{
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00010000);
}
void fourTwo()
{
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00100000);
}
void fourThree()
{
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B01000000);
}
void fourFour()
{
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B10000000);
}
/*
Single lines --- REFERENCE BINARY --------
planeY0 -- Transistor Side of Board
shiftOut(data2, clock2, LSBFIRST, B00001111);
shiftOut(data1, clock1, LSBFIRST, B00000000);
planeY1
shiftOut(data2, clock2, LSBFIRST, B11110000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
planeY2
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00001111);
planeY3
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B11110000);
planeX0 -- Cathode Side of Board
shiftOut(data2, clock2, LSBFIRST, B00010001);
shiftOut(data1, clock1, LSBFIRST, B00010001);
planeX1
shiftOut(data2, clock2, LSBFIRST, B00100010);
shiftOut(data1, clock1, LSBFIRST, B00100010);
planeX2
shiftOut(data2, clock2, LSBFIRST, B01000100);
shiftOut(data1, clock1, LSBFIRST, B01000100);
planeX3 -- Header Side of Board
shiftOut(data2, clock2, LSBFIRST, B10001000);
shiftOut(data1, clock1, LSBFIRST, B10001000);
Cathode 1 -- Bottom Layer
cathodeOn(1);
cathodeOff(1);
Cathode 2
cathodeOn(2);
cathodeOff(2);
Cathode 3
cathodeOn(3);
cathodeOff(3);
Cathode 4 -- Top Layer
cathodeOn(4);
cathodeOff(4);
ALL CATHODES
cathodeOn(0);
cathodeOff(0);
****INDIVIDUAL LEDs / Columns ****
Given in X,Y coordinates.
X = "vSlice" - running from Cathode side of board to Headers
Y = "vWide" -Running from Transistor side of board to empty end of board
(1,1)
shiftOut(data2, clock2, LSBFIRST, B00000001);
shiftOut(data1, clock1, LSBFIRST, B00000000);
(1,2)
shiftOut(data2, clock2, LSBFIRST, B00000010);
shiftOut(data1, clock1, LSBFIRST, B00000000);
(1,3)
shiftOut(data2, clock2, LSBFIRST, B00000100);
shiftOut(data1, clock1, LSBFIRST, B00000000);
(1,4)
shiftOut(data2, clock2, LSBFIRST, B00001000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
(2,1)
shiftOut(data2, clock2, LSBFIRST, B00010000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
(2,2)
shiftOut(data2, clock2, LSBFIRST, B00100000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
(2,3)
shiftOut(data2, clock2, LSBFIRST, B01000000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
(2,4)
shiftOut(data2, clock2, LSBFIRST, B10000000);
shiftOut(data1, clock1, LSBFIRST, B00000000);
(3,1)
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00000001);
(3,2)
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00000010);
(3,3)
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00000100);
(3,4)
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00001000);
(4,1)
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00010000);
(4,2)
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B00100000);
(4,3)
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B01000000);
(4,4)
shiftOut(data2, clock2, LSBFIRST, B00000000);
shiftOut(data1, clock1, LSBFIRST, B10000000);
*/
WOW! And that's all of it.
** I plan on making a library out of most of it! (I just need to figure out how to do that....)
That's (partly) why I've done it the way I have....and included a lot of functions/patterns/sequences that aren't currently being used. I just sort of wrote any/all functions I thought might be useful.... got them working...and plan to call them if/when I need to.
Thanks!