Hi,
I am using struct in my sketch as a global variable. This results in a dynamic memory consumption of, in this case, 210 bytes. (6 x 35byte per struct)
global declaration like this.
#define NameLength 11
struct StuctTank {
byte TankType;
int LevelValue;
int LevelPercent;
int CalEmpty;
int CalFull;
float Temp;
uint8_t TempProbeAddress1[8];
byte ValveType;
byte ValveStatus;
byte ValveTarget;
char Name[NameLength];
};
StuctTank Tank[6];
This works fine for me,
however when i use the EEPROM.put command to store it to the EEPROM i noticed that again the dynamic memory increases with 210 bytes.
Like this:
EEPROM.put(EEposition, Tank);
EEposition+=(sizeof(Tank));
Why is this extra memory necessary? And is there a way to prevent this?
My sketch is getting pretty big and i'm starting to run low on dynamic memory.
Since i am writing over 2000 bytes in total to the EEPROM this way i'm loosing a lot of dynamic memory to this.
can anyone point me into the right direction?