Hello all!
I have an arduino UNO r3 with an adafruit FONA 800 shield and a few other parts connected. I am using v1.8.9 of the IDE on a windows xp machine (yes the OS is old, but it works ).
Currently, the code compiles to 18464 bytes, (57%) program space, Global variables use 1320 bytes (64%) dynamic memory.
I wrote a function to scan the SMS slots on the SIM card the FONA is using. Upon compiling, I notice a drastic reduction is memory used. With the added function, now the code compiles at 12568 bytes (38%) program space, Global variables use 731 bytes (35%) dynamic memory. And of course, the function doesn't preform as expected - the for() loop in the function fails to end.
I have attached the code. The code uses the adafruit FONA library that can be found at:
To see this problem, compile the attached code, and note the memory usage. Then remove the comment from the call to the function on line 137, recompile and note memory usage.
The function that is causing the problem is scanSMSSlots(), and starts at line 840.
I am thinking I am running into a memory problem, which is why the for() loop is failing, but I just don't understand the drastic change in memory usage reported by the compiler.
I welcome any help anyone could offer on how to trouble shoot this.
Randy
tstat_v0.2_temp.ino (31.3 KB)