EEPROM.write on Arduino NANO

Hello,

I've tried to store the value 20000 in EEPROM Adress 0 When I read it out I get return the value 32 When I store 200 it works fine. Is it limitet to 256?

How can I store a bigger value up to 80000 in the EEPROM on the Nano?

Thanks for any help.

Store it in three bytes.

Store it in three bytes.

It would be a lot simpler to use 4 bytes, since a long is 4 bytes. There are a number of ways to get the 4 bytes from a long. One is to use a union:

union
{
   long a;
   byte[4] b;
} stuff;

stuff save;

save.a = longToStore;

// Now, store save.b[0], save.b[1], save.b[2], and save.b[3]