above setup() I have :- uint32_t freemem;
in setup() I have :- Spark.variable(“free” , freemem);
and this which gets called once per second :- freemem = System.freeMemory();
Which says 54284 , now the strange bit !!!
I add a extra big int arrary :- int store{1000}; and get guess what 54284
If you’re not using the array for anything the compiler may optimize it out.
Do you get a warning that tells you something like "variable store[] declared but never used"
Try writing to the store array in your main loop or declaring it volatile.
@jakeypoo , Spot on !!! , I added a couple of line which used the arrary and it went down to 46732 , which I worked out .
2000 arrary x 4 bytes for a int , so 8000 bytes on top of 46732 = 28 bytes short which was my extra code .
@peekay123 , I replaced my int with the uint32_t from the example when it didn`t work.
It still would be nice to know how much flash is used .