你好,
所以我买了一个ZS-040HC-05的Arduino蓝牙模块,我想改变它的名字。我知道了,你必须在AT模式下这样做。我听从了所有的指示
http://www.martyncurrey.com/arduino-with-hc-05-bluetooth-module-at-mode/
我成功地进入了AT模式(红色LED每2秒闪烁一次),但是当我进入串行监视器时,我什么也得不到。
这是我的Arduino代码(大致与那篇文章所描述的完全相同)
#include <SoftwareSerial.h>
SoftwareSerial BTserial(2, 3); // RX | TX
char c = ' ';
void setup()
{
Serial.begin(9600);
Serial.println("Arduino is ready");
Serial.println("Remember to select Both NL & CR in the serial monitor");
BTserial.begin(38400);
}
void loop()
{
if (BTserial.available())
{
c = BTserial.read();
Serial.write(c);
}
if (Serial.available())
{
c = Serial.read();
BTserial.write(c);
}
}
如方法1所述,所有东西都是连接的(其他方法对我不起作用)。我已经将串行监视器波德设置为9600,同时设置为NL和CR。
如果有人对这个问题有经验并解决了它,请帮助:)
非常感谢大家!
发布于 2017-03-08 17:11:57
我为此挣扎了一段时间。
此连接工作的原因是因为串行监视器在与Arduino通信时使用0和1个引脚。不需要程序,因为它是打开监视器时的默认连接。
我希望这能帮到你。
https://stackoverflow.com/questions/42665559
复制相似问题