Page 1 of 1

String variable by UART

Posted: Tue Dec 08, 2020 7:08 pm
by Monaga
Hi
I am doing a project, where I need to send a String variable by UART, in this component you have to determine the waiting time and the length of the chain, but what happens when the length of the chain varies, that is, sometimes it receives 4 another 7 another 2?

How could I receive a String variable that can be variable

Thank you

Re: String variable by UART

Posted: Tue Dec 08, 2020 9:21 pm
by mnf
See https://www.matrixtsl.com/mmforums/view ... it=uart%21 - there are examples of receiving a variable length 'string' and converting this to a number. The 'trick' is to have a 'marker' for the end of string (for example a newline character)

Martin