I am trying to turn ON and OFF a LED with my Android Device through a Bluetooth module (JY-MCU V1.05), I can connect to the module with the key "1234", but when I send a command to the module through the "Bluetooth Terminal" app, there is no respond, no action from the LED.
Here is my installation:
Here is the Arduino code:
char val;
int ledpin = 13;
void setup()
{
pinMode(ledpin = 13, OUTPUT);
Serial.begin(115200);
}
void loop() {
if( Serial.available() )
{
val = Serial.read();
if( val == '0' )
{
digitalWrite(ledpin, LOW);
delay(1000);
Serial.println("13 off");
}
if( val == '1' )
{
digitalWrite(ledpin = 13, HIGH);
delay(1000);
Serial.println("13 on");
}
}
}
(Also tried with a serial of 9600)
Any idea why I can't communicate with the Arduino ?