EEPROM 读写浮点数,大家是怎么处理的?

[复制链接]
bruceding 发表于 2012-12-18 14:03 | 显示全部楼层
//write float f;
float f;
int a;
a=*(int*)&f;
eepromwrite a;//write a to eeprom


//read float f;
float f;
int a;
eepromread a; //read eeprom to a
f=*(float*)&a;

假设int 和float 都为4byte
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 在线客服 返回列表 返回顶部