当我按下 Enter 键时 PuTTY 会发送什么? [英] What does PuTTY send when I press Enter key?

查看:44
本文介绍了当我按下 Enter 键时 PuTTY 会发送什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在拼命地尝试让蓝牙加密狗与我的 Arduino 一起使用,但我无法向它发送它需要的命令.当我通过 USB 到 UART 芯片将它插入我的计算机并从 PuTTY 发送命令 (C) 然后按 Enter 时,我可以使用它.

I am trying desperately to get a Bluetooth dongle working with my Arduino but I can't send it a command that it needs. I can use it when I plug it into my computer via a USB to UART chip and send the command (C) from PuTTY and then press Enter.

蓝牙加密狗的命令表说命令我试图发送它 C 但我不知道如何从 Arduino 代码发送正确的回车符.我尝试使用 Serial.println() 函数以及将 \r 字符添加到我当前的 Serial.write("C\r") 但这些都不起作用.

The Bluetooth dongle's command sheet says that the command I am trying to send it C<cr> but I can't figure out how to send the proper carriage return character from the Arduino code. I have tried using the Serial.println() function as well as adding the \r character to my current Serial.write("C\r") but neither of those are working.

我怎样才能做到这一点?

How can I achieve this?

推荐答案

有趣的是,我可以在 Win 7: PuTTY 上报告相反的情况,我的嵌入式项目仅通过 COM 发送 \r港口.好奇,阅读:令人沮丧的无法解释,但我只是在串行连接的另一端寻找任一字符.

Interestingly, I can report the opposite on Win 7: PuTTY for me and my embedded project is sending ONLY \r over the COM port. Curious, read: frustratingly unexplainable, but I simply look for either character on the other end of the serial connection.

然后,如果您启用每个 CR 中的隐式 LF"在终端选项下,它将同时发送 \r\n.默认行为似乎类似于 Commodore 机器 :D (http://en.wikipedia.org/wiki/换行).谁知道...

Then, if you enable "Implicit LF in every CR" under Terminal options it will send both \r\n. Default behaviour seems to be akin to a Commodore machine :D (http://en.wikipedia.org/wiki/Newline). who knew...

这篇关于当我按下 Enter 键时 PuTTY 会发送什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆