stability problems may occur

hello every body!
I have a big sketch but I have this problem...
please help me.

Sketch uses 13134 bytes (40%) of program storage space. Maximum is 32256 bytes.
Global variables use 1549 bytes (75%) of dynamic memory, leaving 499 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

and I use these libraries:
//included Libraries
#include <EEPROM.h>
#include <SPI.h>
#include <MFRC522.h>
#include <LiquidCrystal.h>
#include <RF24.h>
#include <Bounce2.h>

For informed help, please read and follow the directions in the "How to use this forum" post.

Always post ALL the code, using code tags ("</>" button).

jremington:
For informed help, please read and follow the directions in the "How to use this forum" post.

Always post ALL the code, using code tags ("</>" button).

hello every body!
I have a big sketch but I have this problem...
please help me.

Sketch uses 13134 bytes (40%) of program storage space. Maximum is 32256 bytes.
Global variables use 1549 bytes (75%) of dynamic memory, leaving 499 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

and I use these libraries:

//included Libraries
#include <EEPROM.h>
#include <SPI.h>
#include <MFRC522.h>
#include <LiquidCrystal.h>
#include <RF24.h>
#include <Bounce2.h>

There's a good chance that people here can help you to reduce the dynamic memory usage, but you'll need to post your code. Since it's a big sketch, it likely exceeds the forum's 9000 character limit. For this reason, you can attach the sketch (but please only do that when you can't post text directly in the forum post). If you click the "Reply" button, you'll see an "Attachments and other settings" link that will allow you to make the attachment.

pert:
There's a good chance that people here can help you to reduce the dynamic memory usage, but you'll need to post your code. Since it's a big sketch, it likely exceeds the forum's 9000 character limit. For this reason, you can attach the sketch (but please only do that when you can't post text directly in the forum post). If you click the "Reply" button, you'll see an "Attachments and other settings" link that will allow you to make the attachment.

are you sure?

it's 1242 line!

If you don't want help, don't bother following people's suggestions.

the_SAT:
are you sure?

it's 1242 line!

Yes, we are sure, if you wish us to help reduce your code we need to see the code.

Thanks for posting your code.

The only recommendation I have is to remove the string literals and store them into Program Memory with the F macro.

Romonaga:
Thanks for posting your code.

The only recommendation I have is to remove the string literals and store them into Program Memory with the F macro.

lcd.print("ALI");

change to?

lcd.print(F("ALI"));

the_SAT:

lcd.print("ALI");

change to?

lcd.print(F("ALI"));

Correct.

Romonaga:
Correct.

Is it useful?
there are up to 60 lcd.prints in my project!!! :frowning: :fearful:

the_SAT:
Is it useful?
there is up to 60 lcd.prints in my project!!! :frowning: :fearful:

It will free up your dynamic memory. But it will place more pressure on program storage space.

The simplest way to find out is to start converting and see if the amount of dynamic memory returned is worth the work.

Take this example and run it. Next comment out the println without the F macro, and uncomment the println with the F macro notice the difference in memory use.

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
 /* Serial.println(F("REW Was Here For tHe world to see 1"));
  Serial.println(F("REW Was Here For tHe world to see 2"));
  Serial.println(F("REW Was Here For tHe world to see 3"));
  Serial.println(F("REW Was Here For tHe world to see 4"));
  Serial.println(F("REW Was Here For tHe world to see 5"));
  Serial.println(F("REW Was Here For tHe world to see 6"));
  Serial.println(F("REW Was Here For tHe world to see 7"));
  Serial.println(F("REW Was Here For tHe world to see 8"));
  Serial.println(F("REW Was Here For tHe world to see 9"));
  Serial.println(F("REW Was Here For tHe world to see 10"));*/

  Serial.println("REW Was Here For tHe world to see 1");
  Serial.println("REW Was Here For tHe world to see 2");
  Serial.println("REW Was Here For tHe world to see 3");
  Serial.println("REW Was Here For tHe world to see 4");
  Serial.println("REW Was Here For tHe world to see 5");
  Serial.println("REW Was Here For tHe world to see 6");
  Serial.println("REW Was Here For tHe world to see 7");
  Serial.println("REW Was Here For tHe world to see 8");
  Serial.println("REW Was Here For tHe world to see 9");
  Serial.println("REW Was Here For tHe world to see 10");
  
  
  
}

Romonaga:
It will free up your dynamic memory. But it will place more pressure on program storage space.

Hardly any effect on program space, particularly because the strings were already there, and all you're adding is simple method.

AWOL:
Hardly any effect on program space, particularly because the strings were already there, and all you're adding is simple method.

Agree, hardly any impact, but still felt it was worth noting.

Romonaga:
Agree, hardly any impact, but still felt it was worth noting.

Thank you very much my friend!!!!

I added F() to all lcd.prints and My problem was solved.

thanks a lot!
:wink: :slight_smile:

Sketch uses 16074 bytes (49%) of program storage space. Maximum is 32256 bytes.
Global variables use 483 bytes (23%) of dynamic memory, leaving 1565 bytes for local variables. Maximum is 2048 bytes.

Glad I was able to help.