Hi every one
I am using ATXmega128A1 and the compiler is codevision. Does any one know how to convert 4byte to fload which I stored them into eeprom and I don`t know how can I convert them to float again.
this is the code i used to convert float to byte:
union
{
float KX1;
unsigned char bytevalue[4];
}variable;
Please help me.
Regards
Arash
You don't convert anything to a union, it's a shared memory space that can be referred to in different ways. Save your float to a union consisting of 4 bytes then save the bytes one at a time to EEPROM. To read from the EEPROM, save bytes in consecutive byte sized locations in the union and read it as a float type.
you mean in codevision??? But I wrote my own code to write and read from eeprom. Is it really simple? what about If I what to read from eeprom( I mean for floats)? I must mention that I have 10 float number that I need to store them to eeprom.
thanks
That a lot. one more question: Where does it store in eeprom? I mean Does it store it in first page and so on or it is random? I have more valiables which I need to store in eeprom but they are char and I wrote my own code to store them in specific address of eeprom which I address it. So does this type of storing interfere with other datas?