Hi -
I have wired up 8 MAX7221's to 8 8x8 led matrices and I am able to address the 8 matrices separately using the tomek ness code. However, I find it difficult to address the leds the way I'd like (e.g. as 8 64 led columns) because of how that code works. I have made some progress but it is a little messy.
I prefer the simplicity of the Sprite Animation example that comes in the Matrix library, just build 8 bit masks (B01010101) and load them in. How could I modify the code below to make it possible to address 8 matrices stacked on top of each other as one 8 x 64 sprite? Or as 8 1x64 sprites? Ideally I would like to just load 64 B11111111's instead of the 8 as in the example below. I'm pretty sure I have to modify the Sprite or Matrix library to handle this but I'm not sure where to start. Any help appreciated. Actually what would be really cool would be able to load in a 64 character string that represents the ons and offs of a single column.
// Sprite Animation
// by Nicholas Zambetti <http://www.zambetti.com>
// Demonstrates the use of the Matrix & Sprite libraries
// Displays animated waveform graphic on screen
// Created 29 March 2006
/* create a new Matrix instance
pin 0: data (din)
pin 1: load (load)
pin 2: clock (clk)
*/
Matrix myMatrix = Matrix(0, 2, 1);
/* create a new Sprite instance
8 pixels wide, 8 pixels tall
*/
Sprite wave = Sprite(
8, 8,
B00011000,
B00100100,
B01000010,
B10000001,
B00011000,
B00100100,
B01000010,
B10000001
);
void setup()
{
}
int x = 0;
void loop()
{
myMatrix.write(x, 2, wave); // place sprite on screen
myMatrix.write(x - 8, 2, wave); // place sprite again, elsewhere on screen
delay(75); // wait a little bit
myMatrix.clear(); // clear the screen for next animation frame
if(x == 8) // if reached end of animation sequence
{
x = 0; // start from beginning
}
x++; // advance x coordinate to the right
}
I actually have 16 columns total but they are wired together in banks of 8, so I will control those with 3 other pins and their own matrix.