Did you try using the (PROGMEM) F macro. It is described in the official Arduino documentation at the end of https://www.arduino.cc/reference/en/language/variables/utilities/progmem/
This forces all strings to be stored in Flash memory instead of the scarce SRAM memory.
You can try with a few strings to see if the memory lowers and calculate if it would be enough (to fit in Flash). If even Flash is not enough, than SD card would be an alternative.
Also some refactorings that might clean up the code (not necessarily reduce the memory used):
- instead of the many
if (integerValue == xxx)constructs, useswitch/casestatements. - A possible bug are the identical values within (like 245 and 766 used many times, but for different products)
- Move the function lcd.print("...") inside function
ComScrnand pass the string (usingF(..)) - Similar as above but for
IDScrn, using two strings and set the cursor insideIDScrnas well. (key != NO_KEY && key == 'X')... ifkeyis'X'it can never be NO_KEY so the first check can be removed.if (result == true)can be written asif (result).