hi , iam tring save max/min temp on my arduino to eeprom, but it didnt work (larger displacement when loading )
help me pls
maxtemp is (probably) eight bytes. This...
 EEPROM.write(3, maxtemp);
...writes a single byte to EEPROM not the eight bytes necessary to store maxtemp. You will need to find or develop code that layers on top of EEPROM.write to write all eight bytes.
The same is true for the read. This...
maxe = EEPROM.read(3);
...only reads a single byte of data but you need to read eight bytes.
I remember seeing a library that would help but I can't remember where I saw it. Maybe this was it...
yes i know , i have "system" for this
mintemp = 25.53
i save 25.52 to eeprom1 , but it can save only 25 , i read and
mine = eeprom1 ( 25 ) and subtract from mintemp ( 25.52 - 25 = 0.25) and 0.25 multiple 100 ( 0.25 * 100 = 25 ) and save to eeprom 2
but when a want this reversed its anywhere error and i got +-2°C ...
I suggest something like this to save the scaled values...
int MinScaled;
int MaxScaled;
MinScaled = (int)( mintemp * 100 );
MaxScaled = (int)( maxtemp * 100 );
EEPROM_writeAnything( 1, MinScaled );
EEPROM_writeAnything( 3, MaxScaled );
Then reverse to read the values...
int MinScaled;
int MaxScaled;
EEPROM_readAnything( 1, MinScaled );
EEPROM_readAnything( 3, MaxScaled );
mintemp = MinScale / 100.0;
maxtemp = MaxScaled / 100.0;
If the values are >= -32.767 and <= +32.767 you can scale by 1000 instead of 100.
good idea , i will test , when i go home thx
EEPROM lib reads / writes bytes, but your temperature related variables are double (4 bytes). Arduino converts sources into C, so I recomend to
use C language pointer :
double d;
byte *ptr = &d;
write(ptr[0]); write(ptr[1]); // and also 2 and 3