Best way to store a 10bit value in EEPROM

Hi all!

So this is a quick question.

I want to store a 10-bit ADC value to the EEPROM of my UNO. Problem is that the value that I want to store is 10-bit and the EEPROM is 8-bit.

So what I have to do is split it in two and store the MSB and LSB in two separate memory addresses and then combine them when reading the value.

10 ADC readings get averaged as a float.
I am aware that I can average 8 readings and do a bit shift and avoid doing floating point calculations but I want the accuracy. I’m also not 100% sure how to do the bit shift so any help would be appreciated!

What is the best way to implement this in code?

UNI-T:
So what I have to do is split it in two and store the MSB and LSB in two separate memory addresses and then combine them when reading the value.

Yep that is the way EEPROM read & writes are 1 Byte at a time.

UNI-T:
10 ADC readings get averaged as a float.

float result = addedvalues / 8.0;
If you make sure that the 'addedvalues' variable is big enough to hold the values (uint32_t should do) then writing the 8 as 8.0 makes sure that the calculation is done as a floating point.

UNI-T:
What is the best way to implement this in code?

Just EEPROM.put() and EEPROM.get() any variable, be it byte, int, float, struct, array, ...