void loop()
{
if(Serial.available())
{//if there is data being recieved
blueToothVal=Serial.read(); //read it
}
if (blueToothVal=='n')
{//if value from bluetooth serial is n
digitalWrite(led,HIGH); //switch on LED
if (lastValue!='n')
Serial.println(F("LED 1 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='f')
{//if value from bluetooth serial is n
digitalWrite(led,LOW); //turn off LED
if (lastValue!='f')
Serial.println(F("LED 1 is off")); //print LED is on
lastValue=blueToothVal;
}

if (blueToothVal=='a')
{//if value from bluetooth serial is n
digitalWrite(ledone,HIGH); //switch on LED
if (lastValue!='a')
Serial.println(F("led 2 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='b')
{//if value from bluetooth serial is n
digitalWrite(ledone,LOW); //turn off LED
if (lastValue!='b')
Serial.println(F("led 2 is off")); //print LED is on
lastValue=blueToothVal;
}

if (blueToothVal=='c')
{//if value from bluetooth serial is n
digitalWrite(ledtwo,HIGH); //switch on LED
if (lastValue!='c')
Serial.println(F("led 3 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='d')
{//if value from bluetooth serial is n
digitalWrite(ledtwo,LOW); //turn off LED
if (lastValue!='d')
Serial.println(F("led 3 is off")); //print LED is on
lastValue=blueToothVal;
}

delay(1000);
}

You can Learn by Bangla tutorial on http://workitbd.com/page.php?86

The Arduino code is

char blueToothVal; //value sent over via bluetooth
char lastValue; //stores last state of device (on/off)

void loop()
{
if(Serial.available())
{//if there is data being recieved
blueToothVal=Serial.read(); //read it
}
if (blueToothVal=='n')
{//if value from bluetooth serial is n
digitalWrite(led,HIGH); //switch on LED
if (lastValue!='n')
Serial.println(F("LED 1 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='f')
{//if value from bluetooth serial is n
digitalWrite(led,LOW); //turn off LED
if (lastValue!='f')
Serial.println(F("LED 1 is off")); //print LED is on
lastValue=blueToothVal;
}

if (blueToothVal=='a')
{//if value from bluetooth serial is n
digitalWrite(ledone,HIGH); //switch on LED
if (lastValue!='a')
Serial.println(F("led 2 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='b')
{//if value from bluetooth serial is n
digitalWrite(ledone,LOW); //turn off LED
if (lastValue!='b')
Serial.println(F("led 2 is off")); //print LED is on
lastValue=blueToothVal;
}

if (blueToothVal=='c')
{//if value from bluetooth serial is n
digitalWrite(ledtwo,HIGH); //switch on LED
if (lastValue!='c')
Serial.println(F("led 3 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='d')
{//if value from bluetooth serial is n
digitalWrite(ledtwo,LOW); //turn off LED
if (lastValue!='d')
Serial.println(F("led 3 is off")); //print LED is on
lastValue=blueToothVal;
}

void loop()
{
if(Serial.available())
{//if there is data being recieved
blueToothVal=Serial.read(); //read it
}
if (blueToothVal=='n')
{//if value from bluetooth serial is n
digitalWrite(led,HIGH); //switch on LED
if (lastValue!='n')
Serial.println(F("LED 1 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='f')
{//if value from bluetooth serial is n
digitalWrite(led,LOW); //turn off LED
if (lastValue!='f')
Serial.println(F("LED 1 is off")); //print LED is on
lastValue=blueToothVal;
}

if (blueToothVal=='a')
{//if value from bluetooth serial is n
digitalWrite(ledone,HIGH); //switch on LED
if (lastValue!='a')
Serial.println(F("led 2 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='b')
{//if value from bluetooth serial is n
digitalWrite(ledone,LOW); //turn off LED
if (lastValue!='b')
Serial.println(F("led 2 is off")); //print LED is on
lastValue=blueToothVal;
}

if (blueToothVal=='c')
{//if value from bluetooth serial is n
digitalWrite(ledtwo,HIGH); //switch on LED
if (lastValue!='c')
Serial.println(F("led 3 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='d')
{//if value from bluetooth serial is n
digitalWrite(ledtwo,LOW); //turn off LED
if (lastValue!='d')
Serial.println(F("led 3 is off")); //print LED is on
lastValue=blueToothVal;
}

delay(1000);
}

You can Learn by Bangla tutorial on http://workitbd.com/page.php?86

The Arduino code is

char blueToothVal; //value sent over via bluetooth
char lastValue; //stores last state of device (on/off)

void loop()
{
if(Serial.available())
{//if there is data being recieved
blueToothVal=Serial.read(); //read it
}
if (blueToothVal=='n')
{//if value from bluetooth serial is n
digitalWrite(led,HIGH); //switch on LED
if (lastValue!='n')
Serial.println(F("LED 1 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='f')
{//if value from bluetooth serial is n
digitalWrite(led,LOW); //turn off LED
if (lastValue!='f')
Serial.println(F("LED 1 is off")); //print LED is on
lastValue=blueToothVal;
}

if (blueToothVal=='a')
{//if value from bluetooth serial is n
digitalWrite(ledone,HIGH); //switch on LED
if (lastValue!='a')
Serial.println(F("led 2 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='b')
{//if value from bluetooth serial is n
digitalWrite(ledone,LOW); //turn off LED
if (lastValue!='b')
Serial.println(F("led 2 is off")); //print LED is on
lastValue=blueToothVal;
}

if (blueToothVal=='c')
{//if value from bluetooth serial is n
digitalWrite(ledtwo,HIGH); //switch on LED
if (lastValue!='c')
Serial.println(F("led 3 is on")); //print LED is on
lastValue=blueToothVal;
}
else if (blueToothVal=='d')
{//if value from bluetooth serial is n
digitalWrite(ledtwo,LOW); //turn off LED
if (lastValue!='d')
Serial.println(F("led 3 is off")); //print LED is on
lastValue=blueToothVal;
}