hc-05 was connected to the arduino UNO. Power for hc-05 external - 4V. RX/TX up to 5 and 6 respectively. With the hc-05 power supply, I can connect to the device via my phone and send messages via the Serial Bluetooth Terminal. The next sketch does not send AT-messages. Because mySerial.available() = 0. Why?
#include <SoftwareSerial.h>
const int rx = 5;
const int tx = 6;
SoftwareSerial mySerial(rx, tx);
void setup() {
pinMode(rx,INPUT);
pinMode(tx,OUTPUT);
Serial.begin(9600);
mySerial.begin(38400);
Serial.println("finish setup");
}
void loop() {
if (mySerial.available()) {
const char c = mySerial.read();
Serial.print(c);
}
if (Serial.available()) {
const char c = Serial.read();
mySerial.write(c);
}
}
I changed the power control: +5V take from the arduino, through the voltage divider (2k Om and 1 k Om) to Tx.
Now I have another problem. I send "AT" but get out: