Professional Documents
Culture Documents
Theory:
Bluetooth –It is a wireless technology standard for exchanging data between fixed and
mobile devices over short distances using short-wavelength UHF radio waves in the
industrial, scientific and medical radio bands, from 2.400 to 2.485 GHz, and building
personal area networks (PANs).
Bluetooth spp pro- The software for the Bluetooth client communication tools (ie:
Bluetooth slave mode), Bluetooth serial communication can be tested. This tool three
modules:
1.Bytestream mode: the basic input-output model;
2. Keyboard mode: Can customize the output value of 12 buttons.Each button has three
states each state can send commands event.
3. Command Line: Set the command terminator for communication debugging
Algorithm:.
a. Connecting Arduino with Mobile device using Bluetooth module
Define the temp as character.
Set 9600 for starting serial communication.
Set the pin mode as output which is connected to the LED, digital pin 13 in
this case.
Use digitalWrite() function to set the initial output of LED as LOW.
Use while loop for checking number of bytes.
Use if loop for checking if no. of bytes>0
Use Serial read for checking no. of ports.
If temp=A, then it is noted as Waiting to receive.
Use digitalWrite() function to set the initial output of LED as HIGH for pin
13.
If temp=B,then it would not work.
Use digitalWrite() function to set the initial output of LED as HIGH for pin
13.
Procedure:
Code:
char temp();
void setup()
{
Serial.begin(9600);
PinMode(13,OUTPUT);
digitalWrite(5,LOW);
}
void loop()
{
University Roll No.: 1/16/FET/BCC/1/079
while(!Serial.available());
if(Serial.available()>0)
{
temp=Serial.read();
if(temp==’A’)
{
digitalWrite(13,HIGH);
}
If(temp==’B’)
{
digitalWrite(13,LOW);
}
}