Update your browser to view this website correctly. Update my browser now
Turns on an two LEDs on then off, repeatedly, by multiplexing.
Instead of connecting the LEDs to a common ground they are connected to separate "sink" pins. Setting these pins to LOW turn the LED on, HIGH turns it off. Doing this fast enough gives the impression that all the LEDs are lit at the same time.
Using this method you can add extra LEDs to each row by connecting them from another digital pin to the common sink pin, reducing the number of pins you need to handle them. For example for three rows of six LEDs you would need only 9 pins.