Feb 10, 2006 #1 Z zeby Newbie level 1 Joined Feb 10, 2006 Messages 1 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,288 hey i would like to convert a float number (ie: 0.0433) into a IEEE char[32] i need this function in order to save a float number in an eeprom of 8bits words can u help me? Zeb
hey i would like to convert a float number (ie: 0.0433) into a IEEE char[32] i need this function in order to save a float number in an eeprom of 8bits words can u help me? Zeb
Feb 10, 2006 #2 B btbass Advanced Member level 5 Joined Jul 20, 2001 Messages 1,896 Helped 438 Reputation 880 Reaction score 288 Trophy points 1,363 Location Oberon Activity points 12,887 You could try sprintf? char buffer[SIZE_OF_FLOAT]; float myFloat = 0.0433; sprintf(buffer, "%f", myFloat);
You could try sprintf? char buffer[SIZE_OF_FLOAT]; float myFloat = 0.0433; sprintf(buffer, "%f", myFloat);
Feb 10, 2006 #3 S svicent Full Member level 6 Joined Jul 11, 2001 Messages 322 Helped 33 Reputation 64 Reaction score 7 Trophy points 1,298 Activity points 2,293 I think the article "Output Real Numbers", Circuit Cellar #187, February 2006 can help you. The article implements a float to ASCII function. Regards,
I think the article "Output Real Numbers", Circuit Cellar #187, February 2006 can help you. The article implements a float to ASCII function. Regards,
Mar 11, 2006 #4 E eletro Junior Member level 3 Joined Sep 12, 2002 Messages 28 Helped 2 Reputation 4 Reaction score 1 Trophy points 1,283 Location Moon Activity points 181 #define byte unsigned char byte *app_float; float var = 1.232; app_float = &var; write_eeprom(*app_float++); write_eeprom(*app_float++); write_eeprom(*app_float++); write_eeprom(*app_float); it is correct?
#define byte unsigned char byte *app_float; float var = 1.232; app_float = &var; write_eeprom(*app_float++); write_eeprom(*app_float++); write_eeprom(*app_float++); write_eeprom(*app_float); it is correct?