I made a code to write alternating byte and float variables using the EEPROM.get and EEPROM.put methods with fixed indexes to check the memory size occupied by these variables.
I noticed that when I write a float in address 2 and a byte in 6 the verification process tells me that the byte read in 6 is not the same as I wrote. When I check it in address 7 I get the correct value.
Then I doubt the float data type is 4 bytes or 5 bytes.
The code segment related to the EEPROM is this:
byte a=50;
float b=3.2f;
byte a_read6=0;
byte a_read7=0;
...
EEPROM.put(2,b);
EEPROM.put(6,a);
...
EEPROM.get(6,a_read6);
EEPROM.get(7,a_read7);
if(a_read6==a)
digitalWrite(13,1);//this get low on runtime
if(a_read7==a)
digitalWrite(12,1);//this get high on tuntime, so i think float size is 5 bytes
I appreciate the help in advance.