I'm in the process of creating a sketch in Arduino and when I verify the sketch an error message appears saying that the sketch is too large but I'm not quite sure why. This is the error message that appears:
Sketch uses 12,044 bytes (39%) of program storage space. Maximum is 30,720 bytes.
Global variables use 2,072 bytes (101%) of dynamic memory, leaving -24 bytes for local variables. Maximum is 2,048 bytes.
However, I'm not quite sure why there is this error as my sketch isn't that big: I will upload my sketch too.
Global variables use 2,072 bytes (101%) of dynamic memory, leaving -24 bytes for local variables. Maximum is 2,048 bytes.
There are 2048 bytes of SRAM, used for stack, heap, variables, arrays, all the changeable stuff. You're using 2072. Can likely move a lot of string variables into PROGMEM and get SRAM space free. Then your sketch will look somewhat bigger, while the dynamic memory usage goes down.
I use 1284P a lot, it has 16K of SRAM, I made a sketch that used 14625 bytes of it to blast out user changeable data at 20 KHz rate, 45 bytes at a time.