-
• #2
Am I right to expect that when E.setConsole("Terminal") or Terminal.setConsole(), it says the REPL is connected to this new 'serial port'.
Yes.
So if my code has an error, which I would usually see on left in ide, eg. syntax error. The error should now be displayed on the emulator screen??
Yes, try pasting this into the left-hand side
Terminal.setConsole();setTimeout("lets_error",100)
Cos I cannot see that behavior, but mb its cos the emulator kinda freezes once an error occur and I have to refresh page?
Could be
That's probably it. But obviously if you transfer the REPL to Terminal in the emulator then you have no way of inputting to Bangle.js any more, so it will appear to be crashed unless you added something like a setWatch first
am I correct in expecting console.log to transfer to the connected serial??
It should output to where the REPL currently is, yes...
-
• #3
But obviously if you transfer the REPL to Terminal in the emulator then you have no way of inputting to Bangle.js any more, so it will appear to be crashed unless you added something like a setWatch first
Wasn't so obvious to me :) I think this helps!
-
• #4
setWatch(function(){ console.log("BTN1!");E.setConsole("USB",{force:true});console.log("btmode");},BTN1,{repeat: true}); setWatch(function(){ console.log("BTN2!");E.setConsole("Terminal",{force:true});console.log("termMode");setTimeout(function(){ hi;},100);},BTN2,{repeat: true});
Super ! Emulator was using "USB" instead of "Bluetooth".
I was playing with the
Terminal.println("hello world");
Am I right to expect that when
E.setConsole("Terminal")
orTerminal.setConsole()
, it says the REPL is connected to this new 'serial port'.So if my code has an error, which I would usually see on left in ide, eg. syntax error. The error should now be displayed on the emulator screen?? Cos I cannot see that behavior, but mb its cos the emulator kinda freezes once an error occur and I have to refresh page?
Also ... am I correct in expecting
console.log
to transfer to the connected serial??