Hello all!
I've recently started a project involving a 32x32 LED matrix (bought online) and an Arduino Mega.
Wiring it up and testing it with the example code (Adafruit library and wiring) went well, and everything worked.
I needed the matrix to display my own 32x32 pixel bitmap images (multicoloured) in a sequence to create a looping animation. I decided to use this tutorial and the code from it (fitted the code to 32x32 matrices), testing my own image converted to a c array also worked.
Then, I attempted to load my 47 frames of animation into the code with c arrays (used 42% of memory). The code did not work (LED matrix would not light up at all) unless there were specifically less than or 31 arrays called to display on the matrix.
I'm wondering if I could bypass this limit so I can have my animation displayed properly, unfortunately I do have a limit of two weeks to get this to work properly.
Could anyone potentially point me to a better plan of action?
Thank you.
Edit: My code is here due to character limitations
Hello perideltian,
Welcome to the Arduino fora. I and the other people here want to help you but to do that we need certain bits of information. Without the correct information it is difficult or impossible to give you the help and advice you need. To help us to help you please read General guidance andHow to use this forum and provide the information asked for. Being new here you might think this is asking too much or having rules for the sake of rules, that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of message while we try to get you to tell us what we need in order to help you, this is frustrating for you and frustrating for us.
Common mistakes for people posting here the first time:
Code problems:
Not posting any code while expecting us to work out what is wrong with your code; we are not telepathic and can only find problems in code we can see.
Posting a snippet of code in the belief that the problem is in the code snippet. It is almost always the case that the problem is not where you think it is but elsewhere in the code, hence we need all the code.
Not correctly formatting code. Before posting code use Tools / auto format at the top of the IDE, or use control T. Once you’ve done that use edit / copy for forum.
Posting code without code tags (</>), these are explained in the instructions linked to above. Using code tags makes the code easier to read. Not using code tags means some of the code gets interpreted as HTML with the result that it is displayed with smiley faces and other stuff that should not be there.
Asking for complete code; we are not here to write code for you, we are here to help you if you get stuck writing code yourself. If you really want someone to write code for you please click on ‘report to moderator’ and ask them to move this to ‘Gigs and Collaborations’ and indicate how much you are willing to pay.
Schematics:
The language of electronics is a schematic or circuit diagram. Long descriptions of what is connected to what are generally useless. A schematic is a drawing of what connects to what, please make one and photograph it. We don’t mind if it’s hand drawn, scruffy and does not use the correct symbols. We do mind if you don’t at least try to post a schematic. Please read How to post an image
Questions:
Not being clear about what is being asked, for example not asking a question at all or asking a vague question like ‘please help’ or some such thing.
About us:
Those of us answering questions have a wide variety of backgrounds and electronics knowledge, some though working in electronics, some through electronics as a hobby, some both. Most of us are not trained as teachers so probably miss the finer points of how to teach and explain things effectively. We are not, with the odd exception, employees or representatives of Arduino.
Please also remember we are volunteers doing this for free in our spare time and are more inclined to help people who make it easy for us to provide help by providing the information we ask for.
About you:
We only know about you what you tell us; we need to know your level of experience with electronics or microcontrollers, if we don’t know then we can’t tailor our answer to your level of knowledge. We also don’t know if you have problems with English or language or communications in general unless you tell us. We can be sympathetic about problems we know about, but if you don’t tell us we don’t know.
Thank you.
Then, I attempted to load my 47 frames of animation into the code with c arrays (used 42% of memory
The memory indication does not include memory that is allocated by the program when it is running.
I'm wondering if I could bypass this limit so I can have my animation displayed properly
You could add some paged memory to give you more room, or you could encode the frames so as to use less memory. Techniques like run time encoding, or differential encoding can often define a frame in less bytes than simply just having the one to one encoding you are currently using.
Change to a '1284P, 16K of SRAM vs 8K in the Mega2560.
Do you need more than 32 total IO?