• hat happens if I do something as setTimeout(f,0); That is a 0 timeout call. Is it queued at the end of the events waiting or inserted at the head of the events queue?

    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:

    handler("A")
    handler("B")
    handler("C")
    // ...
    

    But if you have a slow handler, it'll get called with more data:

    handler("ABCDABCDABCDABCDABCDABCD");
    handler("ABCDABCDABCDABCD");
    // ...
    

    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.

  • 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.

About

Avatar for Gordon @Gordon started