I've built a 4x4 LED matrix like this, but the LEDs are arranged in a linear way instead (like a LED strip).
Btw the logic and the connections are the same, so i've tried running the code in that page, but no LED turned on.
Then i've tried connecting each column individally to the Arduino GND directly and this time 4 LEDs turned on correctly (except the 1st of each row which seems to blink).
It is likely i made some mistake since i am new to this kind of LEDs wiring...
well, if everything is wired like that, it should work :p.
It's near impossible to help you here. What you're trying should work, if it doesn't, start going step by step to see where it's going wrong. You're already doing some good analysis by only trying 1 group of 4 leds, start experimenting with what works and what doesn't work, and when you've got more to tell us, come back :).
Well done for getting it working. Did you figure out why that other code did not work for you?
Try to avoid using delay() for long periods (I.e. more than a few milliseconds) because it might cause you problems later. Better to use millis() to time when to switch leds on or off.
I still have to figure out, maybe something has got altered in the copy-paste process... btw now i am just happy it is working!
I've also found an alternative wiring method called "charlieplexing" which could save some Arduino pins, but reportedly it is a bit less safe than this matrix method, do you agree?
eadmaster:
I've also found an alternative wiring method called "charlieplexing" which could save some Arduino pins, but reportedly it is a bit less safe than this matrix method, do you agree?
No, there's nothing "unsafe" about it and a charlieplexed matrix is just a kind of matrix. For 16 leds, you would need 5 arduino pins (up to 20 leds in fact). With 8 pins you can charlieplex 56 leds. As long as you only light one led at a time, you don't need any other components (other than series resistors of course).
For longer LEDs lifespan, is it better to have them blinking or constantly on?
Irrelevant question as your wiring scheme requires "blinking" in order to achieve multiplexing.
Longer LED lifespan is achieved by not allow the LEDs to overheat.