so i could really use some help. i am working on a project where i have 24 strings of 20 LEDS ea. connected to the arduino mega. The code written for the patterns we want to display are very lengthy and take up a lot of space. We have an SD card attached to which i can write .txt and .ino files, i have also been able to read off the files and print it to the serial monitor.
Where i need help is trying to write a code that takes the files on the SD card (filled with command functions) executes one then goes to the next and executes that file/code... and so on. is there anyway this is possible?
Yes. You've already shown that you can read files from the card. All you need to do is decide on a file format and naming convention for the files, and have some way for the Arduino to know / be told which one(s) to play in which order.
ok, yep thats no problem except for telling the arduino which ones to play and how to play them, i have yet to find an example code that can do this. do you know where i could find one?
On Adafruit's blog there's a tutorial and some libraries for working with file data (as opposed to raw hex or binary data).
Edit: Scroll down about a third of the way to get to the actual discussion of the libraries.
If you want, you could get into EEPROM memory. Have an external EEPROM chip and you could store the constant values and patterns in there while you keep only the necessary logic in your arduino.
executes one then goes to the next and executes that file/code... and so on
We are not talking about playing wave files here, are we?
From what I understand, this is about interpreting some commands from a text file.
first, is the EEPROM on the arduino sufficient or should i get an external EEPROM chip?
yep, i am just trying to interpret the text file that has commands like [LEDOn(Color(0,0,250),0,12);] that are all listed in the text file in the correct order. I have put the function definitions in the code that reads the commands so i hope the arduino would know what to do with it from there.
is the EEPROM on the arduino sufficient
1kB (1024 bytes). How many commands do you have?
You can save some space by "codifying" the commands. For example, define the pattern somewhere, then just use its index to refer to it. Like when you write characters on a display and use the ASCII code to refer to the bitmap definition.