5 Replies Latest reply on Oct 20, 2016 12:35 AM by user_1377889

    Integer/Float over UART

    vedant.prusty_1579771

      Hi,

         

      i think this is a noob question here, but anyway. My application involves interfacing an ADXL345 with the PSOC4 BLE, over SPI, and communicating the data to the computer serially via UART.

         

      However, im unale to send the integer data over UART. Here's a short code that im trying to run :

         

      the idea is to print "784.4564549" onto my serial monitor.

         
          float myFloat = 784.4564549;     
      int bytesWritten;     
      char myString[50];     
      bytesWritten = sprintf(myString, "%f", myFloat);     
      UART_UartPutChar(myString);    
      UART_UartPutString("\r\n");   
         

      However, all that the serial monitor prints is a dash!

         

      Any suggestions on how else to send an integer over UART? thanks :)