Max7219 for Linear LED display 150428

Hello Arduino forum,

Building LED display using this layout


and this sketch

[left]
//We always have to include the library
#include "LedControl.h"

/*
Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to LOAD
We have only a single MAX72XX.
*/
LedControl lc=LedControl(12,11,10,1);

/* we always wait a bit between updates of the display */
unsigned long delaytime=100;

void setup() {
/*
The MAX72XX is in power-saving mode on startup,
we have to do a wakeup call
*/
lc.shutdown(0,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,8);
/* and clear the display */
lc.clearDisplay(0);
}

void loop() {
lc.setLed(0,0,0,true);
delay(200);
lc.setLed(0,0,0,false);
delay(200);
lc.setLed(0,0,1,true);
delay(200);
lc.setLed(0,0,1,false);
delay(200);
lc.setLed(0,0,2,true);
delay(200);
lc.setLed(0,0,2,false);
delay(200);
lc.setLed(0,0,3,true);
delay(200);
lc.setLed(0,0,3,false);
delay(200);
lc.setLed(0,0,4,true);
delay(200);
lc.setLed(0,0,4,false);
delay(200);
lc.setLed(0,0,5,true);
delay(200);
lc.setLed(0,0,5,false);
delay(200);
lc.setLed(0,0,6,true);
delay(200);
lc.setLed(0,0,6,false);
delay(200);
lc.setLed(0,0,7,true);
delay(200);
lc.setLed(0,0,7,false);
delay(200);

}
[/left]

The sketch and the breadboard work great.
But would like to make the code more efficient
by using an If statement with an index.
So for the loop function I tried

void loop() {
  
 int indexCol; 
 int indexRow;
int indexAddr;
 
 for(int indexCol=0; indexCol<=7; indexCol++) 
 
lc.setLed(0,0,indexCol,true);
delay(200);
lc.setLed(0,0,indexCol,false);
delay(200);
}

But this blinks the first LED and turns
the remaining seven lights
on and does not turn them off.

Tried several variations on this but no joy.

Started small just doing the first row
of eight LEDs so
some success could be achieved before
getting the rows and columns working
together. But may need some guidance
in getting the row digit to stay the same while
the columns increment seven times,
then increment the row once, increment
the cols seven times, increment the
rows again increment the cols seven
times and so on.

On top of that the first digit in the lc.setLed
statement will have to hold 64 times
before it moves up one and do that
three more time because the system
is meant to operate 320 LEDs which
will take 5 IC 7219s.

If I could get some adult supervision on the
syntax of the For statement it would be much
appreciated.

Thanks.

Allen in Dallas