How do you connect the arduino board to the bluetooth module (HC-06) and then use "AT commands" to reconfigure it's name, pin etc.
I tried this code, but there was an error about 'invalid operands of types 'const char [8]' and 'const char [17]' to binary 'operator+' :
#include <SPI.h>
#include <EEPROM.h>
#include <TouchScreen.h>
#include <SoftwareSerial.h>
#define BLUETOOTH_RX 10
#define BLUETOOTH_TX 11
SoftwareSerial BT(BLUETOOTH_RX, BLUETOOTH_TX);
void setup(void) {
// int passed here should match your Bluetooth's set baud rate.
// Default is almost always 9600
BT.begin(9600);
delay(500);
BT.print("AT");
delay(500);
BT.print("AT+VERSION");
delay(500);
// renames your BT device name to My-Sweet-Project
String nameCommand = "AT+NAME" + "My-Sweet-Project";
BT.print(nameCommand);
delay(500);
if (BT.available() > 0)
Serial.println(BT.readString());
}
I watched a youtube video that showed a 'stupid simple' method. Which worked. Thuogh, it does not work when i replace the command with the command to change the pin (AT+PSWD____) Here is the Video:
Huy-LT:
How do you connect the arduino board to the bluetooth module (HC-06) a
I watched a youtube video that showed a 'stupid simple' method. Which worked. Thuogh, it does not work when i replace the command with the command to change the pin (AT+PSWD____)
It should work if you follow the procedure exactly. There is no difference in the way you send AT commands. Ensure the serial monitor is disconnected.
No. The command is sent from the Arduino programme and the monitor merely receives confirmation that you don't actually need. There is nothing wrong with the method, it is just what it says it is - stupid simple, and is more or less what I use for HC-06.
I might not have been clear in reply#2. IF you have succeeded in sending one AT command to bluetooth, there is nothing wrong with your code or procedure, and you should be able to send another. A failure to send a second command rather suggests loose wiring. It does not suggest the wiring is wrong.
Note also that there is only one baud rate for configuration of HC-06. It is 9600, no exceptions.
If you see the above as a tacit suggestion to ignore reply#5, you are right. You might look here for somebody who knows what he is doing. Arduino and HC-06 (ZS-040) | Martyn Currey
do this all connections. Bluetooth have small push button.remove 5V supply from bluetooth. long press push button then apply 5V to bluetooth module. after that LED on bluetooth module blinking slowely.it indicate that bluetooth enter in AT mode.
upload blank code in arduino. open serial monitor. set baud rate 9600,115200,38400 those suit to your module.
Enter "AT" on Serial monitor. send if you get "OK" response .congratulation device enter in AT mode.