So I have my code. Absolutely massive and quite hard on the RAM. It runs on an Arduino Uno R3, it has two serial connections, to a fingerprint sensor, and to a SIM800L V2.0 board. Then SPI interface to the SD card. It has four output LEDs, one of which is to represent a solenoid lock relay for the time being. I was using the String class up until recently because I figured, using C-style strings would prevent memory overload. Well, partially right. The old code, using the String class, used 82% of the memory space, where as now its 95%. I thought this shouldn't be a problem, after all the memory I need is already allocated, and the rest is int, single char, and bool values. No more then 5 of these in a single function. SO the 88 bytes remaining for use of the program should seem fine. Well, I have no idea anymore because with the String class, the incoming Serial from the computer wouldn't be saved fully. So I could test nothing. Now, with the C-style strings, the board won't even start. the LED i have set to turn on at the end of Setup()n never turns on. Here is my code:
Had to put code in .txt because it is too large for the forum post
I x'ed out the commands and information because it is more or less a security system. I don't need to risk exploiting my system because I let info out like that.
The only error's I am getting aren't errors, but warnings. Those will be in the other "actualError.txt" because I just opened up a text document and put my code in.
I really need to work on my version control... whoops.
The main difference between 82% and 95% is that the cstring memory allocation is done at compile, hence the 95%. The String class uses the stack/heap (if you can understand the following statement),
"The language is defined such that the string object is stored on the stack. string's implementation to construct an object uses memory on the heap"
Bottom line, string class memory use is not reported in the 82%. This is a main reason it's use is avoided. Bottom bottom line, regardless of 82 or 95, you're probably running out.
DKWatson:
The main difference between 82% and 95% is that the cstring memory allocation is done at compile, hence the 95%. The String class uses the stack/heap (if you can understand the following statement),
"The language is defined such that the string object is stored on the stack. string's implementation to construct an object uses memory on the heap"
Bottom line, string class memory use is not reported in the 82%. This is a main reason it's use is avoided. Bottom bottom line, regardless of 82 or 95, you're probably running out.
I understand that.
That is why I moved to c-style strings. My concern is fixing it to actually run.
Whandall:
You should place all those constant strings to PROGMEM.