Read and Write Decimal Number in EEPROM

Sorry, I am a newbie here. Currently I am doing a color sensor project. I wish to store the scanned white balance factor for RGB in EEPROM so it does not recalibrate every time power switch off and on. I have no idea how to do it.

With the functions in the avr/eeprom.h library you can write and read most anything. Integers, floats, arrays, character strings, structs, etc.

What is the format of the data you wish to store?

Use the EEPROM Arduino library.

cattledog: With the functions in the avr/eeprom.h library you can write and read most anything. Integers, floats, arrays, character strings, structs, etc.

What is the format of the data you wish to store?

I had able to write and read it in eeprom. However, the number of digit after the decimal point is missing when read from eeprom.

Write value: 2.64, 2.66 and 2.36 Read value: 2.00, 2.00 and 2.00

Post your code inside of the code tags found at the toolbar icon (Scroll with <>).

The standard EEPROM library only reads and writes bytes. 2.64 will be automatically rounded down to 2.

Look at the EEPROMex library for a version that reads and writes all Arduino variables.