What does PuTTY send when I press Enter?

I am desperately trying to get the bluetooth dongle to work with my Arduino, but I cannot send him the command that he needs. I can use it when I connect to the computer via the USB-UART chip and send the command ( C ) from PuTTY, and then press Enter .

The Bluetooth dongle command form says that I'm trying to send the C<cr> command, but I can’t figure out how to send the correct carriage return character from the Arduino code. I tried using the Serial.println() function, and also add the \r character to my current Serial.write("C\r") , but none of them work.

How can I achieve this?

+9
putty control-characters ascii arduino
source share
8 answers

Interestingly, I can report the opposite in Win 7: PuTTY for me, and my embedded project sends ONLY "\ r" via the COM port. Curious read: frustraitingly inexplicable, but I'm just looking for either a character on the other end of a serial connection.

Then, if you enable "Implicit LF in each CR" in the "Terminal Settings" section, it will send both "\ r \ n". The default behavior is similar to a Commodore: D machine ( http://en.wikipedia.org/wiki/Newline ) ... who knew ...

+6
source share

PuTTY emulates xterm, which emulates vt100. For the putty to send CR / LF when you press enter, enter ESC [20h in the putty knife after connecting to the serial device. This sets the true value of VT100 LNM.

http://vt100.net/docs/vt100-ug/chapter3.html

Line channel / new line New ESC line [20h Line feed ESC [20l

+4
source share

Sending CR + LF is possible in a modified PuTTY. The source code is available at https://github.com/gniemirowski/putty-crlf , and the Windows binary file is available at https://www.grzegorz.net/pliki/putty-crlf.zip . When you launch this version, just go to “Terminal” → “Keyboard” and select “CR LF” for the “Enter Key” option.

enter image description here

+3
source share

If you are looking at an ascii table or similar link, you might be interested in: \ r ou \ x0D

For a better understanding see: http://www.grok2.com/sedfaq6.html

+2
source share

In arduino program, just use Serial.write and both characters:

 Serial.write(13); // CR Serial.write(10); // LF 

And avoid Serial.print , as it is intended for human reading, therefore formatted.

links: write print

+2
source share

I am pretty sure that you are looking for a new \n character.

0
source share

Yesterday I tried to deal with this with another problem. In the standard configuration (on Windows and Linux), if you type “help” and then press “Enter” on the serial port, a bit chain will appear (it is checked using an external connected terminal via RS232 and a logic analyzer):

0x68 (h) 0x65 (e) 0x6c (l) 0x70 (p) 0x0d (CR: carriage return U + 000A)

it looks like PUTTY puts CR on ENTER (regardless of whether you are on Linux or Windows)

0
source share

I tried this very simple code (cr = carriage return)

 Serial.write(13); 

And since the following “typed” characters will contain residual text, this is normal.

0
source share

All Articles