I am trying to figure out why a small sketch is already 29kb.
Pretty much assume it is because a lot of libraries seem to get included on compile (they are not in my code however).
i need the ones i included, but there seem to be a whole lot more getting included, besides the ones i need to edit out myself (like ethernetserver.. i only need client).
... i am making datalogger that logs to sd card and periodicly sends updates to internet. should work with or without internet.
the eeprom lib is included for storing settings of the sketch itself to overcome power loss.
time is needed to be in sync with receiving server.
will those iibs eat all my memory then?
edit: just checked and creating empty sketch with those libs only uses 1186 bytes
rondlite:
a lot of libraries seem to get included on compile (they are not in my code however).
can be true if you dont cut the line in half. It SEEMS they get included because I see libraries scroll by on compile that i did not include in my sketch (like wire etc).
they most likely get included from other libraries. so i thought i might need to tweak them.
when i create a new sketch from the old (so there will be new compile from scratch) it still compiles to 28kb (380 lines of script)
Actually, the linker only includes in the hex file those things that are needed. It's a matter of what it puts in, not what it removes from, the hex file that gets uploaded.
I just editted out all time and udp stuff to change with ajax call to server for current time.
however it only gives me 2kb (same result on clean new sketch, my compiler says does cleanup before every compile so guess thats all good).
taking out entire serial library (Serial prints) will give me another 1kb.
Actually, the linker only includes in the hex file those things that are needed. It's a matter of what it puts in, not what it removes from, the hex file that gets uploaded.
In simple case yes, but linker optimizes unreferenced code and data as well to minimize exe size.
rondlite:
I am trying to figure out why a small sketch is already 29kb.
Pretty much assume it is because a lot of libraries seem to get included on compile (they are not in my code however).