As says when i send AT it endlessly respond OK. And if i enter wrong command it gives me ERROR:(0) endlessly.
I’m running on mega2560. HC-05 worked fine previously. Suddenly it begin to acting weird. Did i kill my HC-05?
here is the code
void setup() {
Serial.begin(38400);
pinMode(32,OUTPUT);
pinMode(42,OUTPUT);
digitalWrite(42,LOW);
delay(200);
digitalWrite(32,HIGH);
digitalWrite(42,HIGH);
Serial.println("Enter AT commands:");
Serial1.begin(38400);
}
void loop()
{
if (Serial1.available()){
Serial.write(Serial1.read());
}
if (Serial.available()){
Serial1.write(Serial.read());
}
}
I’m using a transistor for give power for the HC-05. pin 42 for base and 32 for key pin. here is output.
Enter AT commands:
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
OK
here is a picture