setConsole() #720
Replies: 14 comments
-
Posted at 2015-12-09 by Sacha In addition magic 'ec' is typed on the console. After running the above code waiting ten seconds then hit return. We have the following output:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-12-09 by @gfwilliams Just do It's because the code is executed as it is sent to Espruino (in some cases there wouldn't be enough memory to hold all your program's text and execute it too!), so you're actually moving the console out of the way right in the middle of uploading the code (while echo is off). Adding a setTimeout will mean it gets executed later, after code is executed and echo is turned back on. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-12-09 by Sacha Understand. Thanks. Works. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-18 by sp33c the USB.setConsole seems not be available anymore? Does anyone know why? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-18 by @gfwilliams It's definitely still available - which board are you using, and are you using the latest firmware? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-06-07 by sp33c I get an error telling me command not found. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-06-07 by ClearMemory041063 Some caution is needed when using setConsole if you save the program and do the onInit(). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-06-07 by sp33c Ic yes that makes sense otherwise reflashing could be an option |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-06-07 by sp33c If connected to the usb and ide the Serial obe works just fine. How exactly trick Serial1 to allow the onData to work as in ide if powered from external power source? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-06-07 by @gfwilliams I'm not quite sure I understand the question, but try just adding That will force the console to always stay on USB, allowing you to use Serial1 for whatever you want. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-06-07 by sp33c Gordon, thank you. I could not get it to work. I will be away 3 days.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-06-07 by sp33c I expected a Serial2.setConsole(true) should help, however this results in : |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-06-08 by @gfwilliams Hi -
Using |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-06-12 by sp33c It was my fault. The declination outside of init Serial=Serial1 blocked the USB.setConsole command. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-12-09 by Sacha
Hi Gordon
The following code moves the console to LoopbackA. 10 sec. later back to USB.
It works as expected. But we do not have echo on the console and there is no prompt.
Code:
Beta Was this translation helpful? Give feedback.
All reactions