My 3x3x3 and 5x5x5 LED cube

But my first question is why use transistors? I hooked each layer up to a specific pin and when I want the layer off I just set the pin to HIGH. Is there an advantage to using transistors?

Not just an advantage, but a requirement to use a transistor to enable or disable each layer. As when a layer is enable the amount of current allowed to flow is dependent on the number of leds your software has commanded to be on for that layer and that can vary from 0 to 9 leds for a 3x3x3 cube.

So worst case, 9 leds x 20ma= 180ma is way more current then the arduino output pin controlling the layer can handle, so the need for the arduino output pin to control a switching transistor that can handle that amount of current.

That make sense?

Lefty