LED cube with Arduino Mega 2560

Thread Starter

Rezex124

Joined Jan 31, 2021
11
Hi!
I chose to do a project to make a LED cube, with dimentions 5x5x5. The project is due soon (like 2days) and I have zero code written, because I couldn't find how to use the LED library to make my work waaay easier. If I code my cube with digitalWrite() it's gonna make my job a lot harder.

My anode layers are from D22 to D46 (including D46), from D47 to D51 I have to common cathode from the layers.

If someone can help me with how to use the library or has some examples (or already written code) to send, I would highly appreciate it.
 

KeithWalker

Joined Jul 10, 2017
1,789
We will not do your project for you. If you run into any specific problems when doing it, we will try to help you. It would appear that it is time to get your ass in gear and start learning. It's all out there on the internet.
 

djsfantasi

Joined Apr 11, 2010
7,700
The project is due soon (like 2days) and I have zero code written, ...
I think you’re going to have more difficulties than you imagine.

I couldn't find how to use the LED library to make my work waaay easier. If I code my cube with digitalWrite() it's gonna make my job a lot harder.
You seem to have concentrated more on making the job easy versus solving the assignment.

I think that if you had spent the time making your job easier, on actually doing the job, you might be done now.

IMHO, you’re screwed.
 

Thread Starter

Rezex124

Joined Jan 31, 2021
11
OK I'm aware I came across as the lazy kid who does everything the last second. I have a job alongside school to keep my ''lazy ass'' from starving and with all the school work I just got overwhelmed. I asked for any help with using the library or a bit of code (not asking for 300+ lines) to start me up.
But seeing you would rather judge and tell me how screwed I am, I'm just not gonna waste my time here anymore

Wish you all the best in life
 

dl324

Joined Mar 30, 2015
12,873
I have a job alongside school to keep my ''lazy ass'' from starving and with all the school work I just got overwhelmed.
I know how that feels. When I was taking evening classes at SJSU while I had a full time job as an R&D tech, I had one of my teachers take me aside and tell me not to let work interfere with my studies.
I asked for any help with using the library or a bit of code (not asking for 300+ lines) to start me up.
A lot is going to depend on what you want to display on the cube and how you organize the cube. For some reason most people seem to use shift registers to drive the LEDs.

I built a 4x4x4 cube and used one 64bit word to hold the state of all of the LEDs. But I'm using a Pi Zero W so I can control the display from the command line.
 
Last edited:

Phil-S

Joined Dec 4, 2015
205
Zero chance of getting that done on your schedule.
What library? There must be dozens of libraries with LED in the title.
If you are a total beginner, then you need to get to grips with with the IDE.
All you can do in the time available is look at the examples included in the IDE, find the "Blink" example and get at least one LED working.
Why are you using the Mega? If you make a real hash with that, it's going to put a hole in your finances.
You could try the Arduino forum or the playground examples, but if you frame your question the way you have with only a scant idea of what you want to achieve, you will be quickly shot down.
To quote one of the prolific Arduino posters "The art of getting a good answer is asking a good question"
If you get one out of ten for flashing an LED, you might be lucky.
Even if you find a library, it's going to need some work. If avoiding digitalWrite() is your objective, then I don't see this going very far.
Out of interest, how long have you been working with microcontrollers and how long have you had to complete this project?
I get the feeling you came here in desperation instead of planning your work.
 

Phil-S

Joined Dec 4, 2015
205
I know how that feels. When I was taking evening classes at SJSU while I had a full time job as an R&D tech, I had one of my teachers take me aside and tell me not to let work interfere with my studies.
A lot is going to depend on what you want to display on the cube and how you organize the cube. For some reason most people seem to use shift registers to drive the LEDs.

I built a 4x4x4 cube and used one 64bit word to hold the state of all of the LEDs. But I'm using a Pi Zero W so I can control the display from the command line.
Shift registers or dedicated chips like MAX7220 are used because they work and are well supported.
A nice example of complex LED displays is the library MD_Parola by majicDesigns.
Agreed there other ways of working with LED matrices like your 64 bit example, but I don't think it would help the original poster, especially if they don't like digitalWrite()
 

Phil-S

Joined Dec 4, 2015
205
If you want to see how to do it, there is a lot of info out there -
https://diyodemag.com/projects/programmable_4x4x4_64_led_cube_using_arduino_uno

https://diyodemag.com/projects/octoled3_programmable_8x8x8_512_blue_led_cube

Study up and I hope that you get something running :)
Interesting article, but not a hope in hell of getting that done in 2 days.
Remember they haven't written any code and the code for this example is full of digitalWrites, functions etc.
Quote from one of the commenters on diyodemag:-
" Can someone please post the whole code cuas i cant really be bothered to read all of the code information and i just want to make it work. "
 

click_here

Joined Sep 22, 2020
217
Part 3 goes through some code

Whether the op can get it done is not for us to say: it certainly won't be easy, and I can't see much sleep in their near future!
 
Part 3 goes through some code

Whether the op can get it done is not for us to say: it certainly won't be easy, and I can't see much sleep in their near future!
Have you already assembled the cube of LEDs? That alone will take you almost a week of nights. Then there is a PCB or perf board that holds the array of shift registers and ancillary control circuits that Mega will hook to. If you don’t have that much done, the code is the least of your problems. There is no way that the Mega can drive the cube by itself. I hate to be a downer, but if took your two days (48hours) and worked straight through without sleep, there’s no way you could finish up your project on time.
Sorry
 
Top