Hello
i try to control the led but nothing is ok
my sketch is:
const int ledPin = 2; // the pin that the LED is attached to
byte serialA;
void setup()
{
// initialize the serial communication:
Serial.begin(19200); //baud rate - make sure it matches that of the module you got:
// initialize the ledPin as an output:
pinMode(ledPin, OUTPUT);
}
void loop() {
if (Serial.available() > 0) {serialA = Serial.read();Serial.println(serialA);}
switch (serialA) {
case 49:
digitalWrite(ledPin, HIGH);
break;
case 50:
digitalWrite(ledPin, LOW);
break;
case 51:digitalWrite(ledPin, HIGH);
delay(100);
digitalWrite(ledPin, LOW);
delay(100);
default:
break;
}
}
I can control the led with my PC and the bluetooth v3
on/off/blink
my android ins connect to bluetooth (apaire ok!)
but nothing when i swith on
i dont know what can i do?
thank you
With App programme i send 1, 2, 3
and my baud rate is 19200.