Well, Serial.print doesn't print a line ending, Serial.println does. It's just print() that's there - a bit confusing, but handy for people new to JS who just want to do 'Hello World'.
If you want to print a bit of a line at once, do console.log() which will print a newline (but will clear off the current input line and make sure it gets put back). Then use USB.print() or similar.
I guess to make it more compatible I could make process.stdout and stdin point to the current Serial device.
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.
Well,
Serial.print
doesn't print a line ending,Serial.println
does. It's justprint()
that's there - a bit confusing, but handy for people new to JS who just want to do 'Hello World'.To be honest it looks like a JS thing - it's not just Espruino: http://stackoverflow.com/questions/6157497/node-js-printing-to-console-without-a-trailing-newline
If you want to print a bit of a line at once, do
console.log()
which will print a newline (but will clear off the current input line and make sure it gets put back). Then useUSB.print()
or similar.I guess to make it more compatible I could make
process.stdout
andstdin
point to the current Serial device.