You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I'm considering removing Serial.onData and moving to a more coherent node.js-like API. Your code would have been:

    Serial1.onData(function(e) {
      doStuff(e.data); // single character
    });
    

    And I'd like to change to:

    Serial1.on('data', function(chars) {
      doStuff(chars); // maybe >1 character
    });
    

    I know this will break some stuff, but it'll be faster and more efficient. I'm also planning on adding some stuff at the same time so you'll be able to pipe Serial to other devices (such as files).

    What does everyone think?

About

Avatar for Gordon @Gordon started