3 Replies Latest reply on Jul 20, 2016 11:32 AM by user_501422297

    Display float value using sprintf not working

    user_501422297

      Hi,

         

      i would like to display the results of a division as a float using sprintf and display it using the UART communication component.

         

      My code is give below.

         
          

       

         
         

      float ft,db;

         
          char buffer[20];   
         
              
         
          db=9.9*3.141;    
         
          sprintf(buffer,"value=%f\n\r",db);   
         

      UART_UartPutString(buffer);        

         

       

         

      I don't get any value at all on my terminal program.

         

      Just 

         

      value=

         

      I am unable to understand how to display float values using sprintf.

         

      I am using PSOC Creator 3.2

         

      thanks

         

      a