Well, I've just checked up on the logic for this, and it's:
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);
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Well, I've just checked up on the logic for this, and it's:
Unfortunately there's no callback for when USB is connected or disconnected, so it might be best to just do something like: