Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Convert float to char in 89C51

Status
Not open for further replies.

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
 

You could try sprintf?

char buffer[SIZE_OF_FLOAT];

float myFloat = 0.0433;

sprintf(buffer, "%f", myFloat);
 

I think the article "Output Real Numbers", Circuit Cellar #187, February 2006 can help you. The article implements a float to ASCII function.

Regards,
 

#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?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top