Bluetooth HC-06 I think I broke it

I bought hc-06 then i tried it and it was working. I uploaded code for led from somewhere(i can't find it now) I lighted up the led from my android phone then I noticed Bluetooth's name was "arduinoLed" and i wanted to change it then i tried to change it with AT commands but i couldn't it wasn't responding then i uploaded code from somewhere(I got codes).I just changed name from codes then it changed.Later I uploaded different codes, the codes was working before naming job but it didn't work. Tx led was responding on arduino but nothing happened about the led.I don't know how to fix it.Is there any code for fix it like resetting.

-I think I connected true
-RX>TX
-TX>RX
-GND>GND
-5V>5V

I guess I need resetting codes for HC-06

Thanks for helping or trying or commenting.

PawPaw-:
Bluetooth's name was "arduinoLed"

I bet it isn't, and that was something in your code, which is apparently a secret. That is a stupid name for a bluetooth, and the only way it could get it is because you put it there - which seems unlikely. I don't think there is a reset for HC-06, you just over-write the previous.

I found the codes and I over-writed then I tried to light up the led nothing happened...On arduino Tx was responding my commands.

I used it for first time it worked.I over-writed it.

// HAKKI CAN
// www.hakkican.com
// Arduino HC-06 Modül ile led kontrolü 2015
#define led 2 // led digital 2 pinine bağlı
String gelenText;
void setup() {
  Serial.begin(9600); // seri port 9600 baud
  pinMode(led,OUTPUT); //let pini çıkış olarak ayarlandı
  Serial.print("AT+NAMEArduinoLed"); //HC-06 modülün adını ArduinoLed yapıyoruz
}
 
void loop() {
  while(Serial.available())// eğer seri portta data varsa
  {
    delay(5); //5 milisaniye bekle. Bu bekleme olmadan veri okunamıyor.
    gelenText+=char(Serial.read()); //karakterleri oku
  }
  if (gelenText=="ac") //gelen komut aç ise
  {
    digitalWrite(led,HIGH); // ledi yak
  }
    if (gelenText=="kapat") // kapat ise
  {
    digitalWrite(led,LOW); // ledi söndür
  }
  gelenText=""; // değişkeni temizle
}

Then i noticed the name was "ArduinoLed" then i uploaded different codes for changing name because I lost "ArduinoLed" codes.

char message1[10];//need length of chars being read +1 for null character
char message2[9];

void setup() {
  // set baud rate then delay to give user time to open serial monitor
  Serial.begin(9600);
  delay(5000);
  //Send command to set name of HC06 module, with the below command name will change to "DodonunTeknesironics"
  Serial.print("AT+NAMEDodonunTeknesi");
  delay(600); //HC06 requires 500 msec for reply
  int8_t count = 0; //declare and intialize count 
  while(1) { //loop until OKsetname is read and cleared from buffer
    if(Serial.available()) {
        message1[count] = Serial.read(); //read in char
        count++; 
        if(count == 9) break; //after we get all 9 char break out of loop
    }
    delay(10);
  }
  
  //Send AT command to change baud rate to 115200
  Serial.print("AT+BAUD8");
  delay(600); //HC06 requires 500 msec for reply
  count = 0; //intialize count
  while(1) { //loop until OK115200 is read and cleared from buffer
    if(Serial.available()) {
        message2[count] = Serial.read(); 
        count++; 
        if(count == 8) break; 
    }
    delay(10);
  }
  
  //print out each message to make sure it worked
  Serial.println("");
  Serial.println(message1);
  Serial.println(message2);
}

void loop() {
 //do nothing
  delay(50);
}

Bluetooth's name changed but it wasn't work anymore with different codes.

You may have messed up the HC-06, but it probably isn't broken. It seems you are able to configure HC-06 even if you don't know what you are doing, but I can't see what your intentions are. The comments look like they are in Turkish, which I can't read. I suggest you try to get back to the original settings, and then try to use the module in a sensible manner, i.e. walk before you run. I bet there was never a real need to change the configuration in the first place.

You might find the following background notes useful

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

There is a little bit on configuration.

in the second sketch you change the baud rate to 115200.

//Send AT command to change baud rate to 115200
Serial.print("AT+BAUD8");

Did you change the baud rate used for software serial to match?

// set baud rate then delay to give user time to open serial monitor
Serial.begin(9600);

In my experience 115200 does not work reliably with software serial. The fastest that I have used with 100% success is 38400.

Nick_Pyner:
I suggest you try to get back to the original settings

I tried but how can I do?

Nick_Pyner:
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

I uploaded the code and i tried without connecting bluetooth from serial monitor it worked.I connected bluetooth module then I sent "a" from my phone and it printed "ÿ" for any words i sent.

-If I buy a new Bluetooth module will it work as good as new
-If I buy a new Bluetooth module what should I choose HC-06 or HC-05?
-I'm trying to make a RC boat it was working before I had tried to change its name.

PawPaw-:
then I sent "a" from my phone and it printed "ÿ" for any words i sent.

OK. That might be because the baud rate of Bluetooth does not match that in the code. Don't bother trying to fix Bluetooth, try changing the speed in the code instead. Start with

Serial.begin(115200);

-If I buy a new Bluetooth module will it work as good as new
-If I buy a new Bluetooth module what should I choose HC-06 or HC-05?

The way things are, it appears that there is nothing wrong the wiring, or the code, and nothing fundamentally wrong with bluetooth either. The only problem is that you fiddled around with something best left alone at this time.

A new bluetooth will be fine, and will work fine as it comes out of the box - just don't fiddlearse around until you need to. If 99% of HC-0x users never need to fiddle with them, remember where you heard it first.

An HC-06 will work fine for what you want, but an HC-05 is about the same price so you might as well get one of those, as the extra versatility it offers may be useful in the future.

Nick_Pyner:
OK. That might be because the baud rate of Bluetooth does not match that in the code. Don't bother trying to fix Bluetooth, try changing the speed in the code instead. Start with

Serial.begin(115200);

It worked !!!

MartynC:
in the second sketch you change the baud rate to 115200.

//Send AT command to change baud rate to 115200
Serial.print("AT+BAUD8");

Did you change the baud rate used for software serial to match?

// set baud rate then delay to give user time to open serial monitor
Serial.begin(9600);

In my experience 115200 does not work reliably with software serial. The fastest that I have used with 100% success is 38400.

Thanks to both of you!

Nick_Pyner:
walk before you run.