Pages: 1 [2]   Go Down
Author Topic: Running out of memory - suggestions?  (Read 1402 times)
0 Members and 1 Guest are viewing this topic.
Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Will test it out.
Logged


Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Offline Offline
Full Member
***
Karma: 1
Posts: 105
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 105
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot Nick.  You are always very helpful.
Logged

Pages: 1 [2]   Go Up
Jump to: