Hi,
I have a datalogger with real time clock and SD card. I recently added a FONA SIM800H shield from Adafruit and when I merged the two sketches I ran into dynamic memory issues.
Global variables use 1,765 bytes (86%) of dynamic memory, leaving 283 bytes for local variables. Maximum is 2,048 bytes.
Low memory available, stability problems may occur.
I F() all the serial.print and try to move global variables into the loop or other functions when possible.
These solutions freed very limited amounts of dynamic memory (went from 87% to 86% used).
I am thinking of 2 solutions:
-
Buy a Mega.
Would I be able to use the same shields that I am using with the Uno? Can I use the same sketches? -
Keep improving my sketch but I wonder how much dynamic memory should I free for my sketch to be stable. Do I need to reduce the use of dynamic memory down to 85%? 70%?
Any help is greatly appreciated!
Thanks!
Jerry