Beware of "low memory available" message

Hello all,
I am pretty new to Arduino development and I wanted to post this as it may help somebody else.
I am developing an app that was working fine, and then it went literally haywire. After some careful investigation, I noticed that the "low memory" warning that I had been completely disregarding went from 80% to 85% and that destroyed the application.
In my case, it was a simple task to #ifdef out alot of Serial debug statements and I got back to 80% and all is well.
So keep this in mind if your low memory % is creeping up and things aren't working correctly.

If it's Ram you were low on, you can reduce usage by moving print text to program memory. For example,

Serial.println(F("this is a test"));
will result in the string being stored in program space, not RAM. Can make a big difference with wordy messages.

1 Like

Which memory do you refer to?

Reduce the size and memory usage of your sketch – Arduino Help Center

Check this out. If you still have issues. Post your code in this thread for more suggestions.

Yes, it was RAM. Thanks for the post. I had seen the F in many examples and wasn't quite sure what it was for.
Good to know.
Cheers.

Lots of great tips. Thanks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.