only getting value 255 from EEPROM

cattledog:
Which Arduino do you have? Standard fuse settings are to preserve the EEPROM values. Do you know how the incorrect fuse settings are on your processor?

It is possible to reburn the boot loader and change the fuse settings with another Arduino, and you will not need an icsp custom programmer.

https://www.arduino.cc/en/Tutorial/ArduinoISP

I got the arduino mega 2560, and I looked into burning a new bootloader but you could brick your arduino so i orderd a sd outbreak cause im afraid i will ''code'' it wrong. It is also not my arduino (im on a internship) and they preffer not to do burn a new loader.

What that basicly did is it divided the values by 4

You could, of course, just have divided the value by 4

outputValue /= 4;

Either way you have reduced the resolution of the measurement and, as previously pointed out, you could have used the put() and get() functions to save and read an int value if maintaining the resolution were important.

UKHeliBob:
You could, of course, just have divided the value by 4

outputValue /= 4;

Either way you have reduced the resolution of the measurement and, as previously pointed out, you could have used the put() and get() functions to save and read an int value if maintaining the resolution were important.

I get your point but in this case the value wasn't important (this is an exercise for me cause im doing my internship here). Still thanks keeping this in mind when the value is inportant. thx for the reaction and tips, appreciate your help.

I got the arduino mega 2560, and I looked into burning a new bootloader but you could brick your arduino so i orderd a sd outbreak cause im afraid i will ''code'' it wrong. It is also not my arduino (im on a internship) and they preffer not to do burn a new loader.

If you have a RTC (real time clock) module available, you might find that it has an eeprom included (typically 4K bytes) as part of the module. This will be an "external" eeprom, and is addressed with the Wire library and the I2C protocol. Anything written to it will be persistent through a power shutdown and reboot.

cattledog:
If you have a RTC (real time clock) module available, you might find that it has an eeprom included (typically 4K bytes) as part of the module. This will be an “external” eeprom, and is addressed with the Wire library and the I2C protocol. Anything written to it will be persistent through a power shutdown and reboot.

Unfortunatly i don’t have a RTC module available, but thanks keeping this in mind.