I have a 4x4x4 RGB LED cube. It is set so that each layer's anodes are all connected together. So 4 i/o's per layer.
Then, each column's red cathode, green anode, and blue anode are connected vertically. So 3 cathodes times 16 columns is 48 io's.
Now the problem:
- I find that my cube is brighter when I set every output of one color (lets say green) to high, rather than if I turn each LED on rapidly which is the essence of multiplexing. When I multiplex, they are ridiculously dim. And they are still dimmer than they should be when I set every io to high. They are just not-as dim.
I don't have the code with me (on school computer) but this is I guess what it looks like:
for(int i=2; i<=17; i++){
digitalWrite(i, HIGH);
delayMicroseconds(anAmount from 0 to 250ish);
digitalWrite(i, LOW);
}
And of course in setup I turn everything else low.
The anAmount variable is there because I found that my LEDs get a slight bit brighter at 200 delay before they start blinking.
I'm not sure if delays are included in "proper" multiplexing. And I don't know why my LEDs are so dim. Something to do with power I suppose.
On a side note (I'd be happy if you answer only the above but I'd appreciate an answer to below as well):
I've also seen some crazy videos of 16x16x16 cubes. I was wondering how so many LEDs can be controlled. I already have the biggest Arduino out there and I've essentially already hit the cap on io limit.
A second thing is I want to create an expanding "sphere" of color. That is to say, the innermost 4 LEDs at the center are blue and then the outer layer becomes blue while the innermost layer becomes red and then the next outer layer becomes blue while the layer that turned blue becomes red and the innermost layer becomes green. You know... like how you see in the videos. Fast forward to 2:16
Now, one approach is ultra hard-code everything. But...I've heard the proper method is to use calculus to program cubes. Now I can set up some functions that take in 3d vectors (x, y, z) and turn my cube into a 3 dimensional Cartesian grid I guess. But I'm just not sure how the whole mechanism works out. How is this possible and could someone link me a tutorial? I could only find tutorials on WHAT multiplexing is and how to do simple multiplexing.
I really really appreciate it!