If you examine the schematic you can see just whats going on to enable the use of so many led's with so few pins. The IO toggles between the flow of current, taking advantage of the fact that current cannot flow through led's in reverse bias. So for example connecting the circuit...
(GPIO->Resistor->Led(anode-cathode)->Led(cathode-anode)->Resistor->GPIO pin)
...allows the formula n(pins) can drive n2-n led's
Now looking through the code you can see that the pin assignments are quite similar and 2 of the RGB's are just reflected GPIO pins. |