Serial.on - how to destroy?

Posted on
  • Hi, Gordon!
    Is there a command for Serial class like clearInreval() for setInterval() ?
    I cant destruct It if Serial.on() was called before in the code. But there is the situation in my program, when It saves some data by save() automatically and go to onInit(), then run Serial.on() another instance, which destroy the functionality - I get all the characters twice.

  • Hi Andrey,

    Yes, you can do Serial.removeAllListeners('data') which should remove anything from Serial.on('data', ...)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Serial.on - how to destroy?

Posted by Avatar for Andrey @Andrey