Go Down

Topic: HC-06 replies AT-command with the command itself (Read 484 times) previous topic - next topic

veedemon

May 13, 2016, 07:26 am Last Edit: May 13, 2016, 07:38 am by veedemon
I am currently struggling to reset an HC-06 bluetooth module with AT command since my friend forgot the pin number.
I have my HC-06 LED blinked every 2 seconds (which means I made it into AT command mode). However, it always replies my command with the command itself, like it replies "AT" instead of "OK".

I am using arduino mega 2560 and here's my pin configuration:
VCC  --> VCC
GND --> GND
KEY  --> PIN 9
RX   --> TX1
TX   --> RX1

Has anyone experienced this problem before? Is it possible that my HC-06 is damaged?

Code: [Select]
void setup()
{
  pinMode(9, OUTPUT);
  digitalWrite(9, HIGH);
 
  Serial1.begin(38400);
  Serial.begin(9600);
 
  Serial.println("Enter AT commands:");
}

void loop()
{

  if (Serial1.available())
    Serial.write(Serial1.read());

  if (Serial.available())
    Serial1.write(Serial.read());
}

Go Up