You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Well, I've just checked up on the logic for this, and it's:

    • When USB is plugged in, change console device to be USB
    • When USB is unplugged, if the console device is USB, change it to Serial1

    Unfortunately there's no callback for when USB is connected or disconnected, so it might be best to just do something like:

    setInterval(function() {
      if (process.env.CONSOLE=="Serial1") setConsole(LoopbackA);
    }, 1000);
    
About

Avatar for Gordon @Gordon started