I am trying to pair my HC-05 but I do not think it's working. On the slave module, I use the following AT Commands:
AT=Role=0
AT+UART=38400,0,0
AT+PSWD=1234
AT+ADDR? --> and I write down the address
For the master, I am using the following:
AT+Role=1
AT+UART = 38400,0,0
AT+PSWD=1234
AT+CMODE=1
AT+BIND= "address of slave"
The problem I am seeing is that when I press enter to configure on the master, I get the "OK" on everything but the BIND command. However, when I place them both onto my two Arduino Megas, they blink like they should but it doesn't complete the function. Any suggestions?
I am just using what I have watched on video tutorials. Some have had blank sketches as well. What should I be using? I am completely new to all of this.
Connect the bluetooth device to TX1 and RX1 and use Serial1 to read from/write to it.
Or, connect the bluetooth device to TX2 and RX2 and use Serial2 to read from/write to it.
Or, connect the bluetooth device to TX3 and RX3 and use Serial3 to read from/write to it.
I am not sure what you are asking exactly ("What are you using to send the serial data TO the Arduinos?") I am typing my stuff through the serial monitor on the arduino app on my computer.
where are the serial1, serial2 and serial3 located?
ok, so here is what I am doing. I am connecting a Bluetooth module to a card that has a LDR attached. I need it to send the signal to the other card (with Bluetooth) to turn on LED. I have attached a schematic and my code.
Are you referring to this - {If using multiple software serial ports, only one can receive data at a time.
Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).}
Also, I can see quite well and nothing on my MEGA 2560 is labeled Serial1, Serial2 or Serial3. However, I do know that all the communication pins are serial pins as well as TX0 AND RX0.
And no, I see that 9 is not supported.
So, what do I need to do. Like I said, I am very new to this.
so, I guess what I am asking, because it appears I am approaching this very wrong, is how do I pair two HC-05 modules using two Arduino MEGA 2560 cards?
So here is what I am gathering at this point:
HC-05Arduino MEGA
EN/KEY Serial 1 (wherever that is)
VCC 5v
GND GND
TX TX1
RX RX1
STATE .......
Also, I can see quite well and nothing on my MEGA 2560 is labeled Serial1, Serial2 or Serial3.
I know that. However, there are two pins labeled RX1 and TX1. Those pins are linked to the Serial1 instance. There are two pins labeled RX2 and TX2. Those pins are linked to the Serial2 instance. There are two pins labeled RX3 and TX3. I'm sure you can guess which SerialN instance they are linked to.
OK, I understand that part now. So with that said, do I need to connect the EN/KEY pin to anything? Also, does this just apply to the AT Command piece and then connect it as the code is displayed above for my project?
so with all that you have said....how do I connect the HC-05 modules to the Arduino board to pair them?
EN -->
VCC -->
GND -->
TX -->
RX -->
STATE -->
As you can tell, I am trying to learn this as I try to complete an extremely important project. I really need to be able to get the above code to work between the two Arduino cards utilizing the HC-05 Bluetooth Modules.