Low memory available - New problem

Do you have a lot of Serial.print statements in your code?
If so, any text contained within quoyayion marks is actually using up dynamic memory.

Tyt using the F() macro like this.

Change this:

Serial.println("Hello World");

to this:

Serial.println(F("Hello World"));

You can’t use this technique when serial printing variables, so in that case you can do this:

Serial.print(F("The current temperature reading is: "));
Serial.println(Temp_value);

Commenting-out your Serial.print statements will also mean that they don’t take-up any dynamic memory, as the comments aren’t compiled.

There are other ways to reduce memory usage as well, and lots of tutorials online. Try googling something like “Reducing Arduino memory usage”

Pete.

1 Like