String receive on UART in PSoc 5lp

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RaSh_3782726
Level 3
Level 3
10 replies posted 10 questions asked 5 replies posted

Hi,

Hello when we receive one char on rx pin we use api  ch = UART_1_GetChar();

Using any sensor data (IMU) It receive strings kind of thing Ex: #YPR=-2.87,2.39,96.22

so how to save this string using API ? Which API should be used?

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

rathangshah,

use example below to receive the string

UART string reception garbage value

/odissey1

View solution in original post

0 Likes
2 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

There is no API for reading strings from UART.

I would suggest you to define an End-Of-String character which will indicate where to stop processing for the current string. Usual values are \n or \r.

Bob

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

rathangshah,

use example below to receive the string

UART string reception garbage value

/odissey1

0 Likes