Need HELP WITH SPI LED MATRIX????

Here's the code:

Marc Pesce wrote this code to serve as a animation for burning man (http://markpesce.com/wiki/index.php/Arduino_Burning_Man). I modified the code to display a heart animation that is initiated with a push button. Enjoy.

#include <stdlib.h>

// Try to talk to the LED matrix from SparkFun
// With code stolen from here and there.
// This in theory will work. In practice, who knows?
// Copyright (C) 2006, Mark D. Pesce
// Licensed under the GNU General Public License
//
// As of 18 August 2006 all of this appears to be working quite merrily

#define RG // If the two-color display is used
//#define RGB // If the three-color display is used

// define wiring pins from Arduino to Sparkfun Serial Backback Controller for SPI communication
#define clock 10 // SPI Clock to backpack
#define cs 12 // SPI CS line to backpack - negative logic, FALSE enables, TRUE disables
#define dataIn 11 // SPI Data input line to backpack

// Timings for the waveforms - these are tested and seem to work fine. Change them at your own risk
#define CS_PAUSE 500 // 500 microseconds to settle CS
#define SLOW_DOWN 10 // 20 microseconds minimum for each clock/data access
#define SLOWER_DOWN 9

// Defines for animation
#define FRAME_TIME 175// milliseconds per frame
#define FRAMES 24 // Number of frames used for animations

// Monochrome sprite stuff
#define SPRITE_SIZE 8 // A sprite is stored in 8 bytes

// And the display colors for the RG display
#define black 0
#define red 1
#define green 2
#ifdef RG // Colors if RG display is used, nearest color maps onto available colors
#define amber 3
#define blue 2
#define cyan 2
#define magenta 1
#define white 3
#endif
#ifdef RGB // Colors if the RGB display is used, it's odd since blue ought to be 4 but isn't.
#define blue 3
#define amber 4
#define cyan 5
#define magenta 6
#define white 7
#endif

// Sprites are single-bit-depth entities
// Eventually you'll be able to mix them, I reckon
// For the moment you can just write them to the display
static byte test_sprite[FRAMES][SPRITE_SIZE] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x00,
0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x00,
0x00, 0x00, 0x80, 0x80, 0x40, 0x20, 0x10, 0x00,
0x00, 0x40, 0x80, 0x80, 0x40, 0x20, 0x10, 0x00,
0x00, 0x40, 0xA0, 0x80, 0x40, 0x20, 0x10, 0x00,
0x00, 0x40, 0xA0, 0x90, 0x40, 0x20, 0x10, 0x00,
0x00, 0x40, 0xA8, 0x90, 0x40, 0x20, 0x10, 0x00,
0x00, 0x44, 0xA8, 0x90, 0x40, 0x20, 0x10, 0x00,
0x00, 0x44, 0xAA, 0x90, 0x40, 0x20, 0x10, 0x00,
0x00, 0x44, 0xAA, 0x92, 0x40, 0x20, 0x10, 0x00,
0x00, 0x44, 0xAA, 0x92, 0x44, 0x20, 0x10, 0x00,
0x00, 0x44, 0xAA, 0x92, 0x44, 0x28, 0x10, 0x00,
0x00, 0x44, 0xAA, 0x92, 0x44, 0x38, 0x10, 0x00,
0x00, 0x44, 0xAA, 0x92, 0x7C, 0x38, 0x10, 0x00,
0x00, 0x44, 0xAA, 0xFE, 0x7C, 0x38, 0x10, 0x00,
0x00, 0x44, 0xEE, 0xFE, 0x7C, 0x38, 0x10, 0x00,
0x00, 0x44, 0xEE, 0xFE, 0x7C, 0x38, 0x10, 0x00,
0x00, 0x44, 0xEE, 0xFE, 0x7C, 0x38, 0x10, 0x00,
0x00, 0x44, 0xEE, 0xFE, 0x7C, 0x38, 0x10, 0x00,
0x00, 0x44, 0xEE, 0xFE, 0x7C, 0x38, 0x10, 0x00,
0x00, 0x44, 0xEE, 0xFE, 0x7C, 0x38, 0x10, 0x00,
};

// And the size of the LED matrix
#define DISPLAY_SIZE 64 // 8 x 8 matrix of LEDs

// Sprite Animation System Tokens
#define END 0x00 // Single byte token
#define LOOP 0x01 // Double-byte token, followed by loop point
#define PLAY 0x02 // Double-byte token, followed by array index into
#define COLOR 0x03 // Double-byte token, followed by color
#define REPEAT 0x04 // Double-byte token, followed by number of repetitions

// Variable definitions
byte display[DISPLAY_SIZE];
byte sprite_buffer[DISPLAY_SIZE]; // Used to build sprite-based displays of multiple sprites

// function that puts a byte of data to the display serial interface
void putByte(byte data)
{
byte i = 8;
byte mask;
while(i > 0) {
mask = 0x01 << (i - 1); // get bitmask
digitalWrite(clock, LOW); // tick
if (data & mask){ // choose bit
digitalWrite(dataIn, HIGH); // send data 1
}
else{
digitalWrite(dataIn, LOW); // send data 0
}
delayMicroseconds(SLOWER_DOWN); // Keep the clock pulses even length
digitalWrite(clock, HIGH); // tock
delayMicroseconds(SLOW_DOWN); // Keep clock pulses even length
--i; // move to lesser bit
}
digitalWrite(clock, LOW);
}

// This function writes the contents of a color screen buffer to the display
// Just give it a pointer to the array
void push_buffer(byte array[]) {

// First, we assert the CS, to tell the display we're writing to it.
// We clear the other lines at the same time
digitalWrite(cs, LOW);
delayMicroseconds(CS_PAUSE); // Per the matrix backpack PDF

// Now send the entire array out to the device
for (char j = 0; j < DISPLAY_SIZE; j++) {
putByte(array[j]);
}

// Now we de-assert CS, the display will not accept more data from us
// We also clear the other lines
digitalWrite(cs, HIGH);
delayMicroseconds(CS_PAUSE); // Per the matrix backpack PDF

}

/void fill_display(byte color) {
fill(display, color);
push_buffer(display);
}
/