无法通过 HC-06 连接 BLE

问题描述 投票:0回答:0

问题来了,我尝试通过手机上的HC-06(在Arduino Uno上)连接BLE,它显示“无法与BT01通信”。 Can't communicate with BT01

但是当使用BLE Scanner等应用程序时,我可以在手机上连接BLE并在手机和Arduino之间传输数据。Connect successfully and transfer

这里有一些关于Arduino的数据。

GND -------------- G(GND)

VCC ---------------- 5V

TXD ----------------10

RXD ----------------11

Arduino Uno and HC-06 Arduino Serial Monitor and the picture of trying to connect.

//When receiving data, print it.
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11);  // RX | TX on Arduino
void setup() {
  Serial.begin(9600);
  Serial.println("Enter AT commands:");
  BTSerial.begin(9600);  // HC-06 current bound rate (default 9600)
}

void loop() {
  // Keep reading from HC-06 and send to Arduino Serial Monitor
  if (BTSerial.available())
    Serial.write(BTSerial.read());
  // Keep reading from Arduino Serial Monitor and send to HC-06
  if (Serial.available())
    BTSerial.write(Serial.read());
}

我试过更改密码,检查接线是否正确并更改Arduino上的接线位置,重启电脑,使用其他手机,但没有用。

有人能帮忙吗?thx

bluetooth arduino-uno
© www.soinside.com 2019 - 2024. All rights reserved.