i cannot understand, when i trying to configure and connect bluetooth with my android device. (i used bluetooth HC-05 from lc-technology and Arduino Mega 2560) I’m trying to connect the arduino and android with bluetooth but it failed. This is a code for arduino
char incomingByte;
int LED = 12;
void setup (){
pinMode(LED, OUTPUT);
Serial.begin(9600);
}
void loop(){
if (Serial.available()){
incomingByte = Serial.read();
if(incomingByte == '1'){
digitalWrite(LED, LOW);
}
if(incomingByte == '0'){
digitalWrite(LED, HIGH);
}
}
}
I try to send data from bluetooth device (i use Bluetooth Terminal and BlueTerm) to Bluetooth Arduino and never give a response i've been trying to uses another pin for tx & rx on Arduino Mega 2560, but it never give a response.
Does someone have a solution on that problem ? Thanks before for your help. I'll apreciate you for your help.