Yeah it looks like I have to set the column to HIGH and the row to LOW for the LED to light up.
I also seemed to have had some cables swapped in my wiring.
Still, when I try to power a single LED, I always get multiple LEDs to light up (not even limited to the same row or column).
My current program looks like this:
int ROWS[8] = { 9, 14, 8, 12, 1, 7, 2, 5};
int COLS[8] = {13, 3, 4, 10, 6, 11, 15, 16};
int PINS[16] = {12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2,
13, 14, 15, 16, 17};
void setup()
{
for (int i = 0; i < sizeof(PINS) / sizeof(int); i++)
{
int pin = PINS[i];
pinMode(pin, OUTPUT);
}
// Set all rows to HIGH so that no LED would light up
for (int i = 0; i < sizeof(ROWS) / sizeof(int); i++)
{
digitalWrite(PINS[ROWS[i]], HIGH);
}
}
void loop()
{
digitalWrite(PINS[COLS[0]-1], HIGH);
digitalWrite(PINS[ROWS[0]-1], LOW);
}