Problems of display float value by function

Status
Not open for further replies.

andy40185

Member level 5
Joined
Sep 30, 2011
Messages
80
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,810
Hi all,

I'm using keilc51 complier. I've encountered some problem about displaying some value to lcd.
If I have 2 floating point value(Temp=27.89, Humi=98.77), and use the following
function to display,is it possible? Should I change the float value to char? Have an other solution?
I've tried many times, please help!!

void WriteLCDdata(char i)
{
RS=1;
RW=0;
EN=1;
P1=i;
EN=0;
CheckBusy();
} /* WriteLCDdata */

void WriteLCDstring(count,MSG)
char count;
char MSG[];
{
char j;
for(j=0;j<count;j++)
WriteLCDdata(MSG[j]);
} /* WriteLCDstring */

Regards,
Andy
 

thannara123, it's useful and thanks u so much
 

Hi,

If I want to convert a string to floating value for compare, which function would be available??
e.g. num[]="123456" --> case (num>10): -------
case (num<10): -------

Regards,
Andy
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…