Doing LoopbackA.setConsole() on onInit works great! Serial1 is quiet now ;-)
you could make a handler for USB.onData that would swap the console
back to USB when you pressed a button.
I couldn't fully understand your suggestion.
Do you mean
USB.onData(function (e) { USB.setConsole(); });
?
It seems overkill to on every character received on USB.
Or perhaps you meant assigning USB.setConsole for a press of button?
function onInit(){
LoopbackA.setConsole();
setWatch(function(){ USB.setConsole();}, BTN, true);
}
Anyway, above onInit function seem to behave as I wanted.
(just have to remember to call onInit or LoopbackA.setConsole(); on WebIDE before unplugging USB.)
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.
Thank you very much for you advice, Gordon!
Doing LoopbackA.setConsole() on onInit works great! Serial1 is quiet now ;-)
I couldn't fully understand your suggestion.
Do you mean
?
It seems overkill to on every character received on USB.
Or perhaps you meant assigning USB.setConsole for a press of button?
Anyway, above onInit function seem to behave as I wanted.
(just have to remember to call onInit or LoopbackA.setConsole(); on WebIDE before unplugging USB.)