Hi i've buy an HC-05 and i wanted to test it. I setup this program. Bluetooth module started to blink, but it's not getting seen on mobile .
micheno
#define ledPin 8
int state = 0;
void setup() {
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
Serial.begin(38400); /
}
void loop() {
if(Serial.available() > 0){ // Checks whether data is comming from the serial port
state = Serial.read();
}
if (state == '0') {
digitalWrite(ledPin, LOW);
Serial.println("LED: OFF");
state = 0;
}
else if (state == '1') {
digitalWrite(ledPin, HIGH);
Serial.println("LED: ON");;
state = 0;
}
}
Did you pair the phone to the HC05? Did you connect the HC05 to an app on the phone? What app?
What Arduino board are you using? Using the hardware serial port for both the HC05 and serial monitor will probably not work right.
Use the hardware serial port (Serial, UDB) for program upload, and monitoring program flow and variable values. Use a software or unused hardware serial port for the HC05.
38400 baud is for communicating with the HC05 in AT mode. 9600 baud is the default serial communication mode baud rate.