I think this the classic issue with serin hang when no serin is received.
The trick is to not enter serin until data is available.
This has been covered many times. One option is to use interrupts or handshaking. Alternatively, use a 28X1 which has serin timeout.
Yes, I see I understand that serin is hang when no serin is received so impossible serin timeout or byspass until receive data available only, DAMN!!! Really use a 28X1 which has serin timeout that possible serin timeout when no data available and then bypass the serin then next other command, its great, I will buy 28X1, how make command serin timeout so put time pause right?
It's explained in the manual.
You must set a timeout value and an address (label) which tells the command where to jump to when the timeout happens.
By including a pause which is similar to the timeout value in the "data received" section of your code, you can maintain a reasonably constant itteration rate for your loop irrespective of data or not.
Use 28X1 how make command for timeout from serin when not receive data available? Im saying about 500ms timeout then other command, and then back serin after same 500ms.
Vroom: Like Inglewoodpete said: "slow down some laddy...". Read the serin command from left to right....
The square brackets "[" and "]" indicates that this enclosed part is optional, may use it or may leave it out. You want to use it so your command will look something like this:
The square brackets indicating "optional" caught me out when they first appeared as I made assumptions which were not valid. The timeout is optional - the list of commands shows the alternatives available - but if the timeout is used it must enclosed by square brackets. So ...
I've seen many people get confused by this... including me.
I notice a couple of other BASIC Editors/IDEs have a similar format when explaining the syntax i.e. options and brackets all over the place.
However, the other Editors/IDEs actually provide written examples in their Helps to clear up ambiguity.
Just an extra line or two , showing examples, in the BASIC Manual would help people over the hurdles for Serin and one or two others things as well.
Get typing hippy