reducing your footprint

Hi!

I am trying to upload the attached sketch to an arduino pro mini 3.3V - 8MHz

It is an adaptation from the original Digital Light Wand by sr Michael Ross

Arduino Ide tells me that:

Sketch uses 15,984 bytes (52%) of program storage space. Maximum is 30,720 bytes.
Global variables use 2,125 bytes (103%) of dynamic memory, leaving -77 bytes for local variables. Maximum is 2,048 bytes.
processing.app.debug.RunnerException: Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.
at processing.app.debug.Compiler.size(Compiler.java:338)
at processing.app.debug.Compiler.build(Compiler.java:117)
at processing.app.Sketch.build(Sketch.java:1162)
at processing.app.Sketch.exportApplet(Sketch.java:1180)
at processing.app.Sketch.exportApplet(Sketch.java:1166)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2487)
at java.lang.Thread.run(Thread.java:745)
Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.

Has perhaps anybody a good idea on how to reduce this programm?

ws2812b_6px.ino (5.8 KB)

String m_FileNames[200];

200 file names might be a bit much to hold in memory all at once. Maybe you could keep an index on the SD card and read them as you need them instead of trying to hold them in RAM all the time.

but the fact that the system is ready to hold 200 file names doesnt mean that I am actually doing it. If I change the number here it doesnt mean that I am changing the actual number of files.

As a matter of fact, the sketch is ready to read and trigger just one file.

void loop() {
  SendFile("set01.bmp");
}

I deleted this command anyway to see what happens, and the sketch is now up. I am getting ready to see if it works. :)

camilozk: but the fact that the system is ready to hold 200 file names doesnt mean that I am actually doing it. If I change the number here it doesnt mean that I am changing the actual number of files.

As a matter of fact, the sketch is ready to read and trigger just one file.

void loop() {
  SendFile("set01.bmp");
}

Yes but declaring that array that size reserves that much space in RAM whether you put values there or not.

camilozk: but the fact that the system is ready to hold 200 file names doesnt mean that I am actually doing it. If I change the number here it doesnt mean that I am changing the actual number of files.

As a matter of fact, the sketch is ready to read and trigger just one file.

void loop() {
  SendFile("set01.bmp");
}

A String object reserves six bytes whether or not there is anything in the String, so an array of 200 wastes 1200 bytes.

(I wish you'd simply post the code instead of forcing me to download it)

understood. thanks!