Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hi there, 

   

I got a string from TeraTerm: numbuf and want to convert it to set_voltage (define as float) , so I use sscanf function:

   

sscanf(numBuf, "%f", &set_voltage)

   

Then I want to print that set_voltage to the LCD so I use sprintf to convert it to ASCII string resultbuf (define as char resultbuf[6]) :

   

sprintf (resultbuf, "%3.1f", set_voltage);

   

then use

   

LCD_PrintString(resultbuf); to the LCD.

   

but I got some wierd characters on the LCD.

   

Can anyone explain to my why?

   

I just want to print a float number to LCD. 

0 Likes
9 Replies