Go Down

Topic: Running out of memory - suggestions? (Read 1 time) previous topic - next topic

liudr


dhenry

Quote
Running out of memory - suggestions?


Two highly effective and absolutely sure ways to solve this problem:

1) shrink your code;
2) move to a bigger chip.

liudr


Will test it out.

Arduino 1.5.1 r2 runs normally on my windows 7, 32 bit machine. I don't have an arduino at hand to test the upload but code compiles fine.

dc42


Not many fixed strings but I can delete them.  Attached is my sketch:


The warning message from the IDE very helpfully told you the first thing you needed to do, i.e. use the F() macro for all those string literals you pass to Serial.print() and Serial.println(). Looking at your code, I see that you have ignored that advice. Why are you asking for help here instead? If you don't understand what the message is suggesting, and can't understand it after doing some research, you should say so.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

warren631

Quote
If you don't understand what the message is suggesting, and can't understand it after doing some research, you should say so.

Hello...I thought I did say so:
Quote
What is PROGMEM or F("text") macro and how do I use in my sketch?

Nick Gammon

Reply #6 mentioned it:

Quote
Serial.println(F("This string will be stored in flash memory"));


Put F("xxx") around strings and they stay in program memory and are not copied into RAM. Did you read the linked page?
http://www.gammon.com.au/electronics

warren631

Thanks a lot Nick.  You are always very helpful.

Go Up