cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

 Hai 

   

I want to convert hex to dec value and it display to pc

   

How can i send decimal value through uart for psoc. which logic  is  use here

   

plz help me for programing

0 Likes
Reply
4 Replies
Honored Contributor II

You might want to use the itoa() function: http://www.cplusplus.com/reference/cstdlib/itoa/

0 Likes
Reply
Anonymous
Not applicable

  my question is -->

   
    

suppose if i take decimal value 12345, how can i send to pc using UART ? which conditions are use in c language?

   
0 Likes
Reply
Honored Contributor II

Where does this decimal value come from? Is it something you calculate in your program?

   

Otherwise, have a look at the API for the UART component (http://www3.cypress.com/?rID=48892 )

0 Likes
Reply
Esteemed Contributor

If you want to convert hex to dec char representation use spintf(). Then use

   

void UART_Write(char * aStr, BYTE bCnt) to send the data.

   

 

   

Or use the following to send as chars via Tx, using

   

 

   

void UART_PutSHexByte(BYTE bValue)

   

void UART_PutSHexInt(int iValue)

   

 

   

Regards, Dana.

0 Likes
Reply