#include <SoftwareSerial.h>

SoftwareSerial BT(10, 11); // RX, TX

int ledPin = 9;
char data;

void setup() {
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, LOW);

  Serial.begin(9600);
  BT.begin(9600);   // HC-05 default baud rate
}

void loop() {

  if (BT.available()) {
    data = BT.read();

    if (data == '1') {
      digitalWrite(ledPin, HIGH);  // LED ON
    }

    if (data == '0') {
      digitalWrite(ledPin, LOW);   // LED OFF
    }
  }
}
