trouble with sscanf and sprintf | Cypress Semiconductor
trouble with sscanf and sprintf
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) :
sprintf (resultbuf, "%3.1f", set_voltage);
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.