This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to print floating values on uart

example:

uartprintf("%d",25);-----it will work

but uartprintf("%f",26.123);-----it  will not work.

if there is any uart statement for priting of the float values .please replay me.   

  • Hello Ravi,

    Please have a look at the sensor hub example code from TivaWare for float value printing.

    Regards
    Amit
  • Something like

    sprintf (pstring, "%f\n", floatVar);
    uartprintf ("%s", pstring);

    might work.

    Check that your clib actually supports floating point format. It is often skipped for code size considerations. In that case, printf()/sprintf() fail, too.

    but uartprintf("%f",26.123);-----it  will not work.

    BTW, "26.123" is NOT a float constant, but gets type-promoted automatically. You will see the difference if you do this in tight loops ...