Yes, I can see that's annoying. If someone's left something on the input line, Ctrl-C clears it off (as well as breaking out of a loop if someone's code was in one), so it is often needed.
If you enter a few characters before you disconnect, when you reconnect do you get the same problem? If I changed the Web IDE to send a space before the Ctrl-C it might magically fix it?
The other thing you could do (if you just want to read data from USB with the Web IDE but don't want it breaking things), is to move the console away from USB on startup. For instance you could do:
Serial1.setConsole();
You'd then have to change your console.log(...) to USB.println(...), but whatever the Web IDE then did, it wouldn't be able to mess up your program's execution (until you explicitly moved the console back with USB.setConsole())
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.
Yes, I can see that's annoying. If someone's left something on the input line, Ctrl-C clears it off (as well as breaking out of a loop if someone's code was in one), so it is often needed.
If you enter a few characters before you disconnect, when you reconnect do you get the same problem? If I changed the Web IDE to send a space before the Ctrl-C it might magically fix it?
The other thing you could do (if you just want to read data from USB with the Web IDE but don't want it breaking things), is to move the console away from USB on startup. For instance you could do:
You'd then have to change your
console.log(...)
toUSB.println(...)
, but whatever the Web IDE then did, it wouldn't be able to mess up your program's execution (until you explicitly moved the console back withUSB.setConsole()
)