Mega is able to store over 4K bytes and I have an array of floats, that I am trying to store.
Each float is taking only 7 bytes , so space should not be an issue.
However I am able to store only one float, for the rest I get OVF,
It takes 4 bytes to store a float data type. The first float takes location 0, 1, 2, 3. The next address for a float is 4, not 1.
Read the forum guidelines to see how to properly post code and some hints on how to get the most from this forum. Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
Also know that EEPROMs have a rather limited amount of write/erase cycles before they stop working. Why use EEPROM at all? Why not a RAM residing array, values built in in the source code?
Sorry , I am a new at this, and never took computer science.
Thats the beauty of Arduino, even dum asses can get a project going with help from the real programmers out there...
void loop() {
for (int i = 0; i <= 16; i=i+4) {
Serial.print (STEP_VALS[i],3);
Serial.print (" at ");
Serial.println (i);
delay(100);
}
The for loop is addressing for STEP_VALS values at indexes of 0,4,8,12,16. You do not control the address space for the indexes above 4.
The STEP_VAL indexes are independent of the eeprom storage addresses.
Great! Thanks for Your fine communication! Solved in 16 posts is good! Please click the symbol "solved" for the most important reply!
I don't know the libs You use, like SET_PIN_DB so I can't comment that.
NOTE the remark, only wright to the EEPROM when a value is changed!
40 years ago I was investigating the very first EEPROMs and the number of writings was really highly limited. Modern EEPROMS still have a limited amount of cycles. Do some research, read manuals.... It pays off!