Terminal with Emulator

Posted on
  • I was playing with the Terminal.println("hello world");

    Am I right to expect that when E.setConsole("Terminal") or Terminal.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??

  • 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_e­rror",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...

  • 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!

  • setWatch(function(){ console.log("BTN1!");E.setConsole("USB",­{force:true});console.log("btmode");},BT­N1,{repeat: true});
    
    setWatch(function(){ console.log("BTN2!");E.setConsole("Termi­nal",{force:true});console.log("termMode­");setTimeout(function(){ hi;},100);},BTN2,{repeat: true});
    

    Super ! Emulator was using "USB" instead of "Bluetooth".

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

Terminal with Emulator

Posted by Avatar for d3nd3-o0 @d3nd3-o0

Actions