/* Light up all the LED's in the matrix to test them Nathan Clark */ int row[] = {10,11,12,13,A5,A4,A3,A0}; // These are the Cathodes - Send LOW to turn on LED int col[] = {2,3,4,5,6,7,8,9}; // These are the Anodes - Send HIGH to turn on LED void setup() { for (int thisPin = 0; thisPin < 8; thisPin++) { pinMode(col[thisPin], OUTPUT); // Set selected pin to be an output rather then an input pin pinMode(row[thisPin], OUTPUT); // this is so we cna provide +5v or GND at any pin digitalWrite(row[thisPin], HIGH); // Set all cathodes to have positive voltage at them. Hence LED will not light up irrespective of what the anode is set to } } void loop() { for (int thisrow = 0; thisrow < 8; thisrow++) { // Turn on all LEDS digitalWrite(row[thisrow], LOW); digitalWrite(col[thisrow], HIGH); } delay(500); for (int thisrow = 0; thisrow < 8; thisrow++) { // Turn off all LEDS digitalWrite(row[thisrow], HIGH); digitalWrite(col[thisrow], LOW); } delay(500); }