I've written a program that starts off by waiting for a serin input, when this is received the program happily goes off and does the other things required of it. However at various points within that program I want to "gosub" back to the serin section of code to see if a new piece of data has been sent and if not then as you were via a "return".
When I code for this, the program just stops at the serin command. Having read manual two (see below) am I right in understanding, that when a serin command is used the program will stop at this point until new data is received and a solution to this is to set a timeout value for the serin command. The manual goes on the say read the section on serial download for further info. I've looked through all three manuals but can't seem to find any further info.
How do I go about setting a timeout for the serin command?
When I code for this, the program just stops at the serin command. Having read manual two (see below) am I right in understanding, that when a serin command is used the program will stop at this point until new data is received and a solution to this is to set a timeout value for the serin command. The manual goes on the say read the section on serial download for further info. I've looked through all three manuals but can't seem to find any further info.
How do I go about setting a timeout for the serin command?
Code:
All processing stops until the new serial data byte is received. This command
cannot be interrupted by the setint command. The following example simply
waits until the sequence “go” is received.
serin 1,N2400,(“go”)
:confused:
The M2, X1 and X2 parts can take an optional timeout value and address at the
start of the command. The timeout value, set in milliseconds, is the length of
time the serin command will wait for a serial command to be detected. After the
timeout period , if no signal is detected, program flow will jump to the time out
address.