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);
}
}
