2 つの HC-05 Bluetooth モジュールをマスター デバイスとスレーブ デバイスとして接続しようとしています。これを行うには、AT コマンド モードを使用して 1 つをスレーブ デバイスとして確立し、もう 1 つをマスターとして確立する必要があることを知っています。各モジュールでarduino nanoを使用しています。使用した回路は次のとおりです。
Vcc -----> 5V
GND ----> GND
Rx ------> Rx
Tx ------> Tx
さまざまなオンライン チュートリアルに従い、次のコードを使用しました。
include SoftwareSerial.h
SoftwareSerial BTSerial(0, 1); // RX | TX
void setup()
{
Serial.begin(9600);
BTSerial.begin(9600); // HC-05 default speed in AT command more
Serial.println("Enter AT commands:");
}
void loop()
{
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available()){
Serial.write(BTSerial.read());
}
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available()){
BTSerial.write(Serial.read());
}
}
モジュールのボタンを使用するか、EN ピンをハイに設定することで、2 秒ごとに LED が点滅することで示されるように、モジュールを AT モードにすることができます。しかし、シリアル モニタを使用してモジュールにコマンドを送信した後、コマンドの確認を受け取るべきときに応答がありません。
私が間違っているアイデアはありますか?