I ran into a big problem with a program I'm writing. I didn't realize how little RAM memory is on the Arduino Uno, so even though my program is only about 16k (out of the 32k on the Arduino), as it was allocating the objects it apparently ran out of RAM memory (of which there is only about 2k) and it started doing all sorts of weird behaviors, a lot of which looked like it was corrupting the stack.
So I rewrote a ton of the code so that the objects are simply declared rather than dynamically created. That is, instead of doing something like:
MyObjectClass* pMyDynamicallyAllocatedObject = new MyObjectCLass();
I'm doing this:
And it compiles just fine. But now when I run it NOTHING HAPPENS. Nothing at all. The program does lots of NeoPixel manipulation. Before I hit that RAM wall it was running quite well, lighting up pixels properly. But since I re-wrote it all to do mostly statically allocated objects, it just sits there and does nothing.
I'm assuming that statically declared objects end up in the EEPROM (the 32k section) and not in RAM. Is that right?