- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am using PSoC 5LP and I want to send data to Matlab. I use for example UART_1_PutChar('705'); and I receive only the 5 value. I check the output using Putty and I only see the 5. However, I see some projects that use PutChar to send several, for example: https://www.youtube.com/watch?v=tRZ0t7pupLs
Thank you in advance.
Best Regards.
Solved! Go to Solution.
- Labels:
-
PSOC5 LP MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
To print an integer value, you could write something like
===============
#define STR_BUF_LEN 64
char str[STR_BUF_LEN+1] ;
int32_t raw_value ;
...
raw_value = ADC_DelSig_1_GetResult32() ;
snprintf(str, STR_BUF_LEN, "%d", raw_value) ; // format could be "value = %d\n\r"
UART_1_PutString(str) ;
...
===============
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OsFe,
Te PutChar(ch) accepts only ASCII characters from 0 to 255. So is trimmed to 5. If you need to send ASCII string "705" you need to use PutString("705") command. If you need to send a value, you need to convert 705 into 2-byte array and use PutArray()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
thank you for your response. So, it would be possible to use PutChar to send the value of the ADC obtained from ADC_DelSig_1_GetResult32(); ?
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
To print an integer value, you could write something like
===============
#define STR_BUF_LEN 64
char str[STR_BUF_LEN+1] ;
int32_t raw_value ;
...
raw_value = ADC_DelSig_1_GetResult32() ;
snprintf(str, STR_BUF_LEN, "%d", raw_value) ; // format could be "value = %d\n\r"
UART_1_PutString(str) ;
...
===============
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Moto,
thank you for you response, that helps me.
Regards.