-
• #2
The issue you have is that you have the console on USB, with echo turned on. For instance you usually get a prompt at the beginning of the line like
>
.So if you print something, Espruino must delete that
>
character, then print what you told it to with a newline, then eventually put the>
character back.To avoid it, either:
- Call
echo(0)
to disable echoing - Move the console away from USB (for example with
Serial1.setConsole()
). You can then useUSB.print(...)
to print exactly what you want to USB - no backspaces or deletes. However as the console will be gone, you'll have to reset the Espruino in order to write more code to it.
- Call
-
• #3
Thank you Gordon, calling "echo(0)" is exactly what I needed.
Hi guys,
I am sniffing data coming from the Espruino Pico through virtual COM port (Windows, Python), and I ran into a problem. It seems that each print(X) adds the special "Backspace" character before X, and finally adds "carriage return" +"Line feed".
I wonder if this "Backspace" character is really useful for anything? I am using the serial port for long time, I never had to use this "Backspace" character. If anyone could explain why it is so important, that would be great!
I am a beginner with Python, and I had to find a trick to remove this "BS" character. I tried this one:
Why "2" characters removed? I don't really understand, I thought only had to be removed, but Espruino seems to send another useless character in front of the printed string, maybe '>' ?
If anyone has a better idea on how to keep only the useful data, do not hesitate to post it :-)
Have a nice day.