EEPROM problem

Hello

Im using the function

EEPROM.write(20,var);

But if i use a too high value of numbers to write into EEPROM, its not working!

for Example

var= 10

is working

var= 1112

is not working

how can i fix this? i need to store a value into eeprom that can be 0 to about 4000.

EEPROM is byte values (0-255), for larger numbers you would need to use two bytes. Check out this post for some ideas..

http://forum.arduino.cc/index.php?topic=45220.0

research EEPROMex it lets you read/write byte/int/float and its easy to use

In the latest version of the EEPROM library, you can use EEPROM.put( address, value ) & EEPROM.get( address, ref ) instead of read() and write() for anything bigger than a byte (structures too).

There are more features I'm adding to it, however this one is already implemented in versions 1.6.2 and above of the IDE.

that's good to know.