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

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

问题描述

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

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

我该如何实现?

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

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

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.

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?

解决方案

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.

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天全站免登陆