I want to call a function(turn on and off light) by sending a single char via Bluetooth(HM-10) from an IOS device.
I am able to connect to the module but when I try to send a char nothing happens. It doesn't even print the char in the console.
I've tried using different apps but still have the same results.
The rx pin of the module is connected to D0 and tx to D1.
void setup()
{
Serial.begin(9600);
Serial.println("Enter commands!");
pinMode(13, OUTPUT);
}
void loop()
{
if (Serial.available() > 0) {
command = Serial.read();
Serial.println(command);
switch (command)
{
case 'F':
digitalWrite(13, HIGH);
break;
case 'S':
digitalWrite(13, LOW);
break;
}
}
}