5 Replies Latest reply on May 7, 2016 6:34 AM by user_1377889

    how to send hex (uint 8) via uart

    elampel_1625036

      hello all ,

         

      i have a temp sensor connected to a psoc 4 device ,

         

      this sensor sends to the psoc data via i2c and i recive it as 2 bytes stored in an array EX:

         

      uint8 rawTemperature[2];

         

      rawTemperature[0]=0x68;

         

      rawTemperature[1]=0xfc;

         

      what i want to do is combine the two bytes , convert them  from hex to integer , and then pass the value to UART 

         

      EX:

         

      0x68fc ---> convert to int -->26876 -->convert from int to string --> "26876" --> send to uart via uart_1_UartPutString("temp is: 26876")

         

      i am having problem implementing this casting , 

         

      how can i do it ?

         

      thanks lampel