I am working with Arduino UNO connected with BV4612 display. I am working on a simple code that controls several water pumps. Each pump has several modes it can run in. I store these modes in an array. The number of water pumps may vary, and I'd like to store that value in EEPROM (either arduino's or display's).
When the pump count is fixed, I use fixed value, defined by macro:
#define PUMP_COUNT 18 //How many pumps we have
uint8_t pumpModes[PUMP_COUNT];
void setup(){...}
void loop(){...}
I'd like to get rid of fixed defined value of PUMP_COUNT, and rather load it from EEPROM, or save the new pump count into the EEPROM if needed. However, I can't declare an array if I can't read from EEPROM before setup() function like this (from address 32 for example):
uint8_t pumpModes[EEread(32)];
void setup(){...}
void loop(){...}
Is there a solution to get the value from EEPROM so I can declare global array's length with it?
Thanks.