I've finished coding something, and it ended up using like 200% of my arduino's memory. So, I've been taking steps to reduce my program's memory output, starting with my usage of strings. I've learned that using F()
helps optimize SRAM by putting Strings in flash when using functions like Serial.print()
or Serial.println()
. I've been working to get rid of strings, but oftentimes throughout my code, I have statements like this:
getIRBoolInput("Are you sure about this? (" + String(reconfirmsDone) + "/" + String(timesToReconfirm) + ")")
The only use for this string is to go into a Serial.print()
function later down the line, so I want to be able to use F()
on it. But, I can't-- you can only use F()
on string literals, so anything like variables don't seem to be able to work with it. Are there any alternatives I can do to help optimize memory in situations like this?