Arduino Led cube

Hello everyone,

I am making a Led cube 5x5x5, the idea is to let the user choose which leds should light up by pressing one of the 5x buttons and one of the 5y buttons selecting coordinates of the leds that need to light up in the layer, then move to the next layer with a seperate button.

The idea is to let all the chosen light turn on and off very fast one after the other so my current always remain the same. How can i do this?

Do you know how to turn a single LED on and off ?

what LEDs do you plan to use? e.g. are they simple LEDs you will drive from a digital output or do they have their own control PCB
in a system some years ago we had strings of LEDs each with its own PIC12 connected as a shift register - the data was shifted into the string using data and clock lines and then loaded into the LEDs with a pulse on a load line

The idea is to let all the chosen light turn on and off very fast one after the other so my current always remain the same.

That idea is wrong. First off you need some form of current limit for each LED, normally a resistor. Second you normally multiplex, that is turn on and off rapidly, at least one row at a time not individually. Third the peak current depends on how many LEDs are on at any instant of time.

so i'm just using standart leds, and they will all light up very fast on and off one by one, but i can't seem to find how to code writing and reading in 3 dimensional, seemed easy at first ....

A cube is just an extension of a matrix, this is how these are multiplexed Arduino Workshop
With an array your code doesn’t go round turning the on LEDs on and off, it simply outputs zeros and ones that represent the LED’s state. This is held in memory in the form of an array.
To find the LED number, and hence its place in the array, of a specific pair of coordinates say X Y you take the X number and add it to the Y number times by the maximum number of LEDs in the X direction. Extend this for three dimensions.

It could be done. You would need 30 Arduino pins and 5 resistors. But it would not be a very good way to light your cube. Why do you want to do it this way?

PaulRB:
Why do you want to do it this way?

I suspect because he didn't know about the right way to do it and thought that was how it had to be done.

Grumpy_Mike:
I suspect because he didn't know about the right way to do it and thought that was how it had to be done.

can you give a short code example?

Hello everyone,

I am making a Led cube 5x5x5, the idea is to let the user choose which leds should light up by pressing one of the 5x buttons and one of the 5y buttons selecting coordinates of the leds that need to light up in the layer, then move to the next layer with a seperate button.

The idea is to let all the chosen light turn on and off very fast one after the other so my current always remain the same. I’ve heard i should better work with rows, but i don’t understand, How can i do this?

You can blink a led, it will appear less bright.

I did code that where a few leds lit one, turned it off and lit the next, etc, and at the end lit the first, etc.
Doing that only drew 20mA at any instant BUT by the time there's 6 leds in the list they look pretty dim.

Will you let your user light ALL the leds?

For the display I coded, at 'random' times one of the set got switched for a different led.
All the user saw were a bunch of blinking leds.

How well do you understand BlinkWithoutDelay?

I have only got compleat projects to show you but this one is a 4 by 4 RGB matrix and you can down load the full software from this page. Mini Monome

Or an 8 by 8 monochrome matrix Econo Monome

@zedpython, do not cross-post. Threads merged.