How can you use the F() macro when there is nothing to apply it to? You clearly have some different concept of a "blank progamm" than I do.
Sorry with "blank" i meant a sketch initialising a lcd and setting up Tinydebug for testing purposes, that´s why i encircled the blank with "`s ![]()
Another method that seems to be even simpler is the following:
Declare this function:
int freeRam () {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}and call it anywhere in your program like that: Serial.println(freeRam());
That´s what i used for calculating my available ram and i put it inside my menu output which is located very deep in my programm structure.
*Edit: When i put freeRam where i alter digits of values i get strange results(-13760, 520, 109).
buttoncheck() -> menu() -> someothermethod()
I guess you mean that with "nest calls" ?
In my menu method i use Strings to print to the display, i guess i could save some ram when i use chars ?
string - Arduino Reference - Found some info about it but it is not clear to me what uses more ram
If i use one of the following:
char Str4[ ] = "arduino";
char Str5[8] = "arduino";
it is easy to use but i´m still using Strings to fill my char array, just the printing will be done with a char array instead of a String ?
char Str2[8] = {'a', 'r', 'd', 'u', 'i', 'n', 'o'};
char Str3[8] = {'a', 'r', 'd', 'u', 'i', 'n', 'o', '\0'};
One of theese would be better in terms of ram usage ?