I have paired two hc-05 Bluetooth using AT command mode. I can not find at all any code for sending info back and forth between them. All I can find is how to pair them. Can you help me find a source code. It would be much appreciated.
I blew up one of my HC-05 modules while playing for the first time with them
But it should be a matter of using standard serial methods like read and print (as far as I understand it). Assuming you use software serial
sketch one (transmitter)
void loop()
{
if(Serial.available())
{
// get data from PC and send over bluetooth
swSerial.print(Serial.read());
}
}
sketch 2 (receiver)
void loop()
{
if(swSerial.available())
{
// get data from bluetooth and send to PC
Serial.print(swSerial.read());
}
}
Use two terminal programs (or two instances of the IDE and their respective serial monitors), hook up bth Arduinos and test.
MR-Turtle:
I have paired two hc-05 Bluetooth using AT command mode. I can not find at all any code for sending info back and forth between them. All I can find is how to pair them. Can you help me find a source code. It would be much appreciated.
Take them both out of command mode.
Write some stuff to one of them using software serial write.
After a few milliseconds, the stuff that you wrote should be available on the other using software serial read.
thanks i will try these suggestions