You are reading a single comment by @asez73 and its replies.
Click here to read the full conversation.
-
Hello,
I must be blind: I had totally forgotten the Testing environment included in the web ide.
So, as you wrote, there are videos explaining how to use it.
Yes, it's executed after the Serial events have been processed - that could change at some point in the future though.
However the 'real-time' handling of Serial events may do what you need anyway. When it calls your
on('data'
handler, it searches for all the Serial data it can find on the top of the event queue and calls the handler with it.Suppose you have a stream of data
ABCDABCDABCDABCD...
and you have a very fast handler that can execute data as it comes in, it'll get called with:But if you have a slow handler, it'll get called with more data:
I guess perhaps by splitting off your handling you could detect whether you had more than one GPS sentence waiting to be processed and could voluntarily drop one rather than filling up the input buffer.