我用我的Arduino UNO安装了HC-06蓝牙硬件设备。
Arduino上的RX与HC-06上的TX连接,反之亦然.它们共有5V和GND。
我想和Blynk取得联系。我已经在我的Android手机上安装了Blynk小部件(摩托罗拉Nexus 6),它检测HC-06并连接到它(HC-06上稳定的LED )。
下面是我上传到Arduino的代码:
#define BLYNK_USE_DIRECT_CONNECT
#define BLYNK_PRINT Serial
// You could use a spare Hardware Serial on boards that have it (like Mega)
#include <BlynkSimpleSerialBLE.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "af0f68df444b43edbcd37bc7147ab608";
void setup()
{
// Blynk will work through Serial
// 9600 is for HC-06. For HC-05 default speed is 38400
// Do not read or write this serial manually in your sketch
Serial.begin(9600);
Serial.println("Setting up");
Blynk.begin(Serial, auth);
// It never gets here
Serial.println("Connected");
}
void loop()
{
Blynk.run();
}下面是我在串行监视器上看到的内容:
Setting up
[0]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.4.7 on Arduino Uno
[95] Connecting...
[6094] Connecting...
[12094] Connecting...
[18094] Connecting...
[24094] Connecting...
[30094] Connecting...就这样继续下去。我做错了什么?我已经干了好几个小时了。
发布于 2017-10-26 05:05:21
HC-06不是一种无刷电子设备,它基于BC04芯片,支持蓝牙2.1。
https://stackoverflow.com/questions/43670223
复制相似问题