#include<BluetoothSerial.h>
#define ledPIN 2
BluetoothSerial SerialBT;
byte BTdata;
void setup()
{
pinMode(ledPIN,OUTPUT);
Serial.begin(115200);
SerialBT.begin("baby");
Serial.println("Bluetooth is start ready to pair...")
}
void loop()
{
if(SerialBT.available());
{
BTdata=SerialBT.Read();
Serial.Write(BTdata);
}
if(BTdata=='1')
{
digitalWrite(ledPIN,HIGH);
}
else
{
digitalWrite(ledPIN,LOW);
}
}