/*
* The program for ON/ Off LED Using Bluetooth
* MAC+tech Development
* http://macplustechnology.blogspot.in/
* Email: macplustech@gmail.com
*
*/
char data = 0; //Variable for storing Bluetooth incoming data
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT); //output pin (+5V) other connect (GND)
}
void loop()
{
if(Serial.available() > 0) // resive data
{
data = Serial.read(); //Read the incoming data
Serial.print(data); //Print ValueSerial monitor
Serial.print("\n MAC+tech");
if(data == '1') //Checks whether value of data is equal to 1
digitalWrite(13, HIGH); //If value is 1 then LED turns ON
else if(data == '0') //Checks whether value of data is equal to 0
digitalWrite(13, LOW); //If value is 0 then LED turns OFF
}
}
load to Arduino And Send data though Android App. where make simple android app. to send data though Bluetooth .....
* The program for ON/ Off LED Using Bluetooth
* MAC+tech Development
* http://macplustechnology.blogspot.in/
* Email: macplustech@gmail.com
*
*/
char data = 0; //Variable for storing Bluetooth incoming data
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT); //output pin (+5V) other connect (GND)
}
void loop()
{
if(Serial.available() > 0) // resive data
{
data = Serial.read(); //Read the incoming data
Serial.print(data); //Print ValueSerial monitor
Serial.print("\n MAC+tech");
if(data == '1') //Checks whether value of data is equal to 1
digitalWrite(13, HIGH); //If value is 1 then LED turns ON
else if(data == '0') //Checks whether value of data is equal to 0
digitalWrite(13, LOW); //If value is 0 then LED turns OFF
}
}
load to Arduino And Send data though Android App. where make simple android app. to send data though Bluetooth .....
No comments:
Post a Comment
Thank You!!!