I am collecting the digital values(integers) and doing a computation, which is of double type. I tried displaying the values using sprintf()
and it is only displaying the integers correctly as neither float
nor double is being converted to string.
Is there any function from library that can be of use here to convert double -> string?
str is a character array and tempC is a double
sprintf(str,"%4f",tempC );
LCD_Position(1,0);
LCD_PrintString(str);
Note:dtostrf() is not available in the system And both sprintf and snprintf, did not work.
To use printf family functions on embedded targets you need to tell the compiler that you are happy to sacrifice plenty of FLASH memory to support it.
-Wl,-u,vfprintf -lprintf_flt -lm
-specs=nano.specs -lc -u _printf_float