Codes to copy/paste for pairing a HC-05 master Bluetoot module to a HC-06 Blueetooth slave module
If you search on how to pair a HC-05 and a HC-06 together, you can find several posts or videos on the subject. I tried all those ways but in the end, I had to find my own way to do it. So this is how I paired the two modules together. You just have to copy/paste the code into the terminal program while holding the small button on the HC-05 and you’re done. Don’t forget the HC-05 must be plugged into a USB to serial port into the computer and the termninal program should be at 9600 bauds. If it doesn’t work, try switching to 38400 bauds; this should do the trick.
So here’s the code I’m using to pair two devices.
ATÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â should answer OK
AT+UART?                should be +UART:9600,0,0 if not, make next line command
AT+UART=9600,0,0Â Â Â to set back the baudrate to 9600 bauds
AT+RMAADÂ Â Â Â Â Â Â Â Â Â Â Â Â Â clear all paired devices
AT+ROLE=1Â Â Â Â Â Â Â Â Â Â Â Â Â turns it into the master
AT+BIND=0Â Â Â Â Â Â Â Â Â Â Â Â Â Â binds it to a dummy address
AT+CMODE=0Â Â Â Â Â Â Â Â Â only allows it to be connected to the bind address
AT+INQM=0,5,5Â Â Â Â Â Â searches the device
AT+INQÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Only if no address is showing
AT+BIND=<address>Â binds the address