Controlling Individual LEDs on a 8X8 LED board

Hi there,

I'm currently having a problem just be able to control which LED I want to be lighted up on my 8X8 LED board.
What I have below is a sample code that would run through an array and would light up each individual LED. However, when I run the program, somehow each individual LED on the top row also lights up through the whole array (see .GIF for clarification). Is this a problem within my code or the way I might have wired it up?

To put it another way, I'm just trying to code a simple program that would allow me to control which LED I would like to be ON. How would I do that? Since my attempt so far has failed to do that.

My code:

int rowPins[]    = {19, 18, 11, 7, 12, 5, 4, 16}; //assign row lines
int columnPins[] = {13, 17, 9, 10,  2, 8, 3,  6}; //assign col lines

void setup() { 
  int i;          
  for (i=0; i<8; ++i) {
    pinMode(rowPins[i], OUTPUT);  
    pinMode(columnPins[i], OUTPUT);    
  }
}
void loop () {
  int x, y;
  for (y=0; y<8; ++y) {
    digitalWrite(rowPins[y], LOW);
    for (x=0; x<8; ++x)  {
      digitalWrite (columnPins[x], HIGH);
      delay(250);     // wait about .25 seconds
      digitalWrite(columnPins[x], LOW);
    }
    digitalWrite(rowPins[y], HIGH);
  } 
}

bzo5w.gif

If you are not using an Arduino UNO the analog pins might not be numbered 14,15,16,17,18,and,19. You should use the values A0, A1, A2, A3, A4, and A5 to reference those pins.

You might also want to initialize the ROW pins to HIGH and COLUMN pins to LOW in setup(), just to be sure.

Thanks for commenting John. I am using an Arduino NANO so I guess there might be a problem in the pin assignments? I took your advice and initialized the ROW pins to HIGH and COLUMN pins to LOW in the setup() and I'm still getting the same output. I'm guessing there might have been a mismatched within the wiring (I didn't do the wiring myself, but it was affirmed that it was correct). Otherwise, I can't see any flaws in my code.

I solved the problem! It was simply a miswired on the breadboard! Thank you for the feedback though John.