Jump to content

Data was shifted when i use UART

Recommended Posts

Hi everyone,

I make a GUI and send a string contains 4 bits,

The first time i send ( E.g "1234") I have received "1234"

But the 2nd i have received "2341", so on the third i have received "3412"

So data was shifted, I have debugged and detected in my received string have a char with value ="10" (LF), Although i havent send it.

How can i fix my error?

Plz give a solution, thank in advance.

Link to post
Share on other sites

1) Welcome

2) What does your code look like?

3) What language did you use to build your GUI?

4) Your string contains 5 bytes.


The 10/LF is the line-feed control character and is sent as the result of either:

- pressing enter, which might be contained in the sent string

- using a println() or writeln() or similar function to send your string, in this case use print() or write() or similar instead

- adding a \n in the sent string ("1234\n" instead of "1234")

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...