Readuntil Function


EOlsen

Recommended Posts

When working with serial I/O does using the ReadUntil function automatically give up a thread's time slice until the next character is received, or do we still need to embed some sort of delay in a code loop continually polling I/O hardware?

Link to comment
Share on other sites

If there are no characters in the comm buffer, the thread will go to sleep waiting for the characters (up to the timeout value for the port).  However, you still should at least put a delay() inside the catch() block if you have one.  The reason is that if you, for example, have a typo in your read command and that throws some non-comms related error and the read never happens, you end up with a fast loop.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.