I am using a pointer to a structure to write into eeprom.
struct CFG {
byte configEmpty;
byte motorSpeed;
byte pulleyRatio;
byte maxSpeed;
byte minSpeed;
byte pulsesPerMeter;
byte downRampDistance;
byte upRampDistance;
byte jobSize;
byte jobRollCount;
byte jobMeterCount;
};
struct CFG config;
struct CFG *cfg_ptr;
Then i use the pinter like this and get an error that a lvalue is required as the lefthand operand. Please help.
void readConfig(void)
{
for(byte i=0; i < sizeof(config);i++)
{
cfg_ptr = &config;
byte value = EEPROM.read(i);
(cfg_ptr++) = value;
LCD.print(value);
}
}