int BT = 2;
int ledPin = 3;
void setup() 
{
  Serial.begin(9600);
  pinMode(BT, INPUT);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  int a = digitalRead(BT);
  Serial.println(a);
  delay(100);
  if(a==0)
  {
    digitalWrite(ledPin, LOW);
  }
  else
  {
    digitalWrite(ledPin, HIGH);
  }
}