Saving data to eeprom

Status
Not open for further replies.
Thank for the reply.
Actually, i know how is the routine like to write and read to eeprom. My problem is that i dunnno how to implement it. I suppose to store the calibration value of light sensor to the eeprom so that my main program will know it when my device is first power up. I just don't understand how is the things work from saving the value and read the value.

Here is the example of what have my friend done:

# define FCIN_ADDR 0x00

result= ReadEeprom(FCIN_ADDR);
result<<=8; // i dun understand why must it shift by 8
tem=ReadEeprom(FCIN_ADDR+1);// why must it increment by1
result+=tem;

Regards
 
Last edited:
The above code reads a 16 bit value from the EEPROM 8 bits at a time.

Given that you did not understand what the <<= operator was you either need
to learn C or have you friend help you.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…