SlideShare uma empresa Scribd logo
1 de 12
INTERFACING TWO ARDUINO
BOARDS USING RN-42
BLUETOOTH

Presented By:
Sumit chakraborty
Basic Command Sets
STEP- 1:
Cont..
STEP- 2: Connect Your device With bluetooth and pc.
STEP -3 : Change to command mode($$$)
STEP -4: Press D to see your Bluetooth configuration.
Cont..
Some Basic Modes Of Operation
1. Slave Mode(SM,0) – This is default mode.
2. Master Mode(SM,1) – This mode is useful when
the device wants to initiate connection
Command Mode VS Data Mode
Upon power up the device will be in data mode. To
enter command mode, send the characters “$$$”
through the serial port or from the remote
Bluetooth connection.
To exit command mode, send “---<cr>”
HOW TO CHANGE THE Baudrate
Default Baudrate is 115200
To change to 9600 – SU,96

Range of Baudrate the module supports:
{1200, 2400, 4800, 9600, 19.2, 28.8, 38.4,
57.6, 115K, 230K, 460K,
921K },
Program of Master Bluetooth
module
//Master
// Before going forward first Download TextFinder.h
#include <TextFinder.h>
String Remote ="00066649533C"; // Address of slave device
void setup()
{
Serial.begin(9600);
//baudrate
Serial.print("$$$");
// command mode
delay(100);
Serial.println("c,"+ Remote +"r");
// connect to the device
delay(100);
Serial.println("SM,1");
// master
delay(100);
Serial.println("---,"+ Remote +"r");
// exit from command mode and enter data mode
delay(100);

}
Cont..
void loop()
{
Serial.println("L"); // Send ‘L’ in data mode
delay(100);
Serial.println("H"); // Send ‘H’ in data mode
delay(100);
}
Program for Slave Blutooth module
//Slave
#include <TextFinder.h>
String Remote ="0006664953B0"; // Address of master bluetooth
void setup()
{
Serial.begin(9600);
// baudrate
Serial.print("$$$");
// command mode
delay(100);
Serial.println("c,"+ Remote +"r");
// connecting to the slave
delay(100);
Serial.println("SM,0");
// slave mode
delay(100);
Serial.println("---,"+ Remote +"r");
// exit from command mode
delay(100);

}
Cont..
void loop()
{

if(Serial.available() > 0) // Check if data is available
{
char ch = Serial.read(); // read the incoming data
if(ch == 'L')
{
digitalWrite(13,HIGH);
delay(100);
}
else if(ch == 'H')
{
digitalWrite(13,LOW);
delay(100);
}
}
}
Interfacing two arduino boards using rn 42 bluetooth

Mais conteúdo relacionado

Destaque

Smart home management system based on BLE
Smart home management system based on BLESmart home management system based on BLE
Smart home management system based on BLEsanamsupraja12
 
IoT-Stockholm-Intro_to_BLE
IoT-Stockholm-Intro_to_BLEIoT-Stockholm-Intro_to_BLE
IoT-Stockholm-Intro_to_BLEShahzada Hatim
 
Bluetooth low energy
Bluetooth low energyBluetooth low energy
Bluetooth low energySaptadeep Pal
 
Bluetooth, RFID and WiMAX Technologies
Bluetooth, RFID and WiMAX TechnologiesBluetooth, RFID and WiMAX Technologies
Bluetooth, RFID and WiMAX TechnologiesMukesh Chinta
 
Wireless tv audio transmitter
Wireless tv audio transmitterWireless tv audio transmitter
Wireless tv audio transmitterVikram Shankar
 
Bluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technologyBluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technologyLin Steven
 
Bluetooth Low Energy - A Case Study
Bluetooth Low Energy - A Case StudyBluetooth Low Energy - A Case Study
Bluetooth Low Energy - A Case StudyFReeze FRancis
 
5G Cloud RAN & IoT Architecture
5G Cloud RAN & IoT Architecture5G Cloud RAN & IoT Architecture
5G Cloud RAN & IoT ArchitectureSathiya keerthi
 
An Introduction to BLUETOOTH TECHNOLOGY
An Introduction to BLUETOOTH TECHNOLOGYAn Introduction to BLUETOOTH TECHNOLOGY
An Introduction to BLUETOOTH TECHNOLOGYVikas Jagtap
 
A Reference Architecture for IoT
A Reference Architecture for IoT A Reference Architecture for IoT
A Reference Architecture for IoT WSO2
 
Library management system
Library management systemLibrary management system
Library management systemRaaghav Bhatia
 
Bluetooth Presentation
Bluetooth PresentationBluetooth Presentation
Bluetooth Presentationguest664c3f
 
Bluetooth technology presentation
Bluetooth technology presentationBluetooth technology presentation
Bluetooth technology presentationKrishna Kumari
 

Destaque (15)

Bluetooth Technology
Bluetooth TechnologyBluetooth Technology
Bluetooth Technology
 
Smart home management system based on BLE
Smart home management system based on BLESmart home management system based on BLE
Smart home management system based on BLE
 
IoT-Stockholm-Intro_to_BLE
IoT-Stockholm-Intro_to_BLEIoT-Stockholm-Intro_to_BLE
IoT-Stockholm-Intro_to_BLE
 
Bluetooth low energy
Bluetooth low energyBluetooth low energy
Bluetooth low energy
 
Bluetooth, RFID and WiMAX Technologies
Bluetooth, RFID and WiMAX TechnologiesBluetooth, RFID and WiMAX Technologies
Bluetooth, RFID and WiMAX Technologies
 
Wireless tv audio transmitter
Wireless tv audio transmitterWireless tv audio transmitter
Wireless tv audio transmitter
 
Bluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technologyBluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technology
 
Bluetooth Low Energy - A Case Study
Bluetooth Low Energy - A Case StudyBluetooth Low Energy - A Case Study
Bluetooth Low Energy - A Case Study
 
5G Cloud RAN & IoT Architecture
5G Cloud RAN & IoT Architecture5G Cloud RAN & IoT Architecture
5G Cloud RAN & IoT Architecture
 
An Introduction to BLUETOOTH TECHNOLOGY
An Introduction to BLUETOOTH TECHNOLOGYAn Introduction to BLUETOOTH TECHNOLOGY
An Introduction to BLUETOOTH TECHNOLOGY
 
A Reference Architecture for IoT
A Reference Architecture for IoT A Reference Architecture for IoT
A Reference Architecture for IoT
 
Library management system
Library management systemLibrary management system
Library management system
 
Bluetooth Presentation
Bluetooth PresentationBluetooth Presentation
Bluetooth Presentation
 
Bluetooth technology presentation
Bluetooth technology presentationBluetooth technology presentation
Bluetooth technology presentation
 
IoT architecture
IoT architectureIoT architecture
IoT architecture
 

Semelhante a Interfacing two arduino boards using rn 42 bluetooth

Communication &amp; switching networks lab manual
Communication &amp; switching networks lab manualCommunication &amp; switching networks lab manual
Communication &amp; switching networks lab manualMUSAAB HASAN
 
How to use mmdvm host wif main board
How to use mmdvm host wif main boardHow to use mmdvm host wif main board
How to use mmdvm host wif main boardAURELIO PY5BK
 
How to use mmdvm host - main board
How to use mmdvm host - main boardHow to use mmdvm host - main board
How to use mmdvm host - main boardAURELIO PY5BK
 
Hc 05-at command-set
Hc 05-at command-setHc 05-at command-set
Hc 05-at command-setYang Garcia
 
Android Bluetooth Introduction
Android Bluetooth IntroductionAndroid Bluetooth Introduction
Android Bluetooth IntroductionErin Yueh
 
Cataloge ge 3.control and_automation-26_vat300_e_c6-12_rev_b
Cataloge ge 3.control and_automation-26_vat300_e_c6-12_rev_bCataloge ge 3.control and_automation-26_vat300_e_c6-12_rev_b
Cataloge ge 3.control and_automation-26_vat300_e_c6-12_rev_bDien Ha The
 
Adtran 1200167L1
Adtran 1200167L1Adtran 1200167L1
Adtran 1200167L1savomir
 
Hướng dẫn cài đặt switch planet layer 3
Hướng dẫn cài đặt switch planet layer 3Hướng dẫn cài đặt switch planet layer 3
Hướng dẫn cài đặt switch planet layer 33c telecom
 
GSM GPRS sim900 a modem with stub antenna and sma connector-USB
GSM GPRS sim900 a modem with stub antenna and sma connector-USBGSM GPRS sim900 a modem with stub antenna and sma connector-USB
GSM GPRS sim900 a modem with stub antenna and sma connector-USBRaghav Shetty
 
Development of a Low Cost, Reliable & Scalable Home Automation System.
Development of a Low Cost, Reliable & Scalable Home Automation System.Development of a Low Cost, Reliable & Scalable Home Automation System.
Development of a Low Cost, Reliable & Scalable Home Automation System.imtiyazEEE
 
VoiceBootcamp Ccnp collaboration lab guide v1.0 sample
VoiceBootcamp Ccnp collaboration lab guide v1.0 sampleVoiceBootcamp Ccnp collaboration lab guide v1.0 sample
VoiceBootcamp Ccnp collaboration lab guide v1.0 sampleFaisal Khan
 
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptxVenuVenupk1431
 
operating and configuring cisco a cisco IOS device
operating and configuring cisco a cisco IOS deviceoperating and configuring cisco a cisco IOS device
operating and configuring cisco a cisco IOS devicescooby_doo
 
03 umts radio path and transmissionnew
03 umts radio path and transmissionnew03 umts radio path and transmissionnew
03 umts radio path and transmissionnewsivakumar D
 

Semelhante a Interfacing two arduino boards using rn 42 bluetooth (20)

Switching 2
Switching 2Switching 2
Switching 2
 
Communication &amp; switching networks lab manual
Communication &amp; switching networks lab manualCommunication &amp; switching networks lab manual
Communication &amp; switching networks lab manual
 
How to use mmdvm host wif main board
How to use mmdvm host wif main boardHow to use mmdvm host wif main board
How to use mmdvm host wif main board
 
How to use mmdvm host - main board
How to use mmdvm host - main boardHow to use mmdvm host - main board
How to use mmdvm host - main board
 
Hc 05-at command-set
Hc 05-at command-setHc 05-at command-set
Hc 05-at command-set
 
Android Bluetooth Introduction
Android Bluetooth IntroductionAndroid Bluetooth Introduction
Android Bluetooth Introduction
 
Cataloge ge 3.control and_automation-26_vat300_e_c6-12_rev_b
Cataloge ge 3.control and_automation-26_vat300_e_c6-12_rev_bCataloge ge 3.control and_automation-26_vat300_e_c6-12_rev_b
Cataloge ge 3.control and_automation-26_vat300_e_c6-12_rev_b
 
Adtran 1200167L1
Adtran 1200167L1Adtran 1200167L1
Adtran 1200167L1
 
Commisioning.pptx
Commisioning.pptxCommisioning.pptx
Commisioning.pptx
 
Hướng dẫn cài đặt switch planet layer 3
Hướng dẫn cài đặt switch planet layer 3Hướng dẫn cài đặt switch planet layer 3
Hướng dẫn cài đặt switch planet layer 3
 
GSM GPRS sim900 a modem with stub antenna and sma connector-USB
GSM GPRS sim900 a modem with stub antenna and sma connector-USBGSM GPRS sim900 a modem with stub antenna and sma connector-USB
GSM GPRS sim900 a modem with stub antenna and sma connector-USB
 
Development of a Low Cost, Reliable & Scalable Home Automation System.
Development of a Low Cost, Reliable & Scalable Home Automation System.Development of a Low Cost, Reliable & Scalable Home Automation System.
Development of a Low Cost, Reliable & Scalable Home Automation System.
 
VoiceBootcamp Ccnp collaboration lab guide v1.0 sample
VoiceBootcamp Ccnp collaboration lab guide v1.0 sampleVoiceBootcamp Ccnp collaboration lab guide v1.0 sample
VoiceBootcamp Ccnp collaboration lab guide v1.0 sample
 
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
 
Readme
ReadmeReadme
Readme
 
operating and configuring cisco a cisco IOS device
operating and configuring cisco a cisco IOS deviceoperating and configuring cisco a cisco IOS device
operating and configuring cisco a cisco IOS device
 
Day 13.1..1 catalyst switch
Day 13.1..1 catalyst switchDay 13.1..1 catalyst switch
Day 13.1..1 catalyst switch
 
Real to protected_mode
Real to protected_modeReal to protected_mode
Real to protected_mode
 
Tp link extender setup
Tp link extender setupTp link extender setup
Tp link extender setup
 
03 umts radio path and transmissionnew
03 umts radio path and transmissionnew03 umts radio path and transmissionnew
03 umts radio path and transmissionnew
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Interfacing two arduino boards using rn 42 bluetooth

  • 1. INTERFACING TWO ARDUINO BOARDS USING RN-42 BLUETOOTH Presented By: Sumit chakraborty
  • 2.
  • 4. Cont.. STEP- 2: Connect Your device With bluetooth and pc. STEP -3 : Change to command mode($$$) STEP -4: Press D to see your Bluetooth configuration.
  • 5. Cont.. Some Basic Modes Of Operation 1. Slave Mode(SM,0) – This is default mode. 2. Master Mode(SM,1) – This mode is useful when the device wants to initiate connection
  • 6. Command Mode VS Data Mode Upon power up the device will be in data mode. To enter command mode, send the characters “$$$” through the serial port or from the remote Bluetooth connection. To exit command mode, send “---<cr>”
  • 7. HOW TO CHANGE THE Baudrate Default Baudrate is 115200 To change to 9600 – SU,96 Range of Baudrate the module supports: {1200, 2400, 4800, 9600, 19.2, 28.8, 38.4, 57.6, 115K, 230K, 460K, 921K },
  • 8. Program of Master Bluetooth module //Master // Before going forward first Download TextFinder.h #include <TextFinder.h> String Remote ="00066649533C"; // Address of slave device void setup() { Serial.begin(9600); //baudrate Serial.print("$$$"); // command mode delay(100); Serial.println("c,"+ Remote +"r"); // connect to the device delay(100); Serial.println("SM,1"); // master delay(100); Serial.println("---,"+ Remote +"r"); // exit from command mode and enter data mode delay(100); }
  • 9. Cont.. void loop() { Serial.println("L"); // Send ‘L’ in data mode delay(100); Serial.println("H"); // Send ‘H’ in data mode delay(100); }
  • 10. Program for Slave Blutooth module //Slave #include <TextFinder.h> String Remote ="0006664953B0"; // Address of master bluetooth void setup() { Serial.begin(9600); // baudrate Serial.print("$$$"); // command mode delay(100); Serial.println("c,"+ Remote +"r"); // connecting to the slave delay(100); Serial.println("SM,0"); // slave mode delay(100); Serial.println("---,"+ Remote +"r"); // exit from command mode delay(100); }
  • 11. Cont.. void loop() { if(Serial.available() > 0) // Check if data is available { char ch = Serial.read(); // read the incoming data if(ch == 'L') { digitalWrite(13,HIGH); delay(100); } else if(ch == 'H') { digitalWrite(13,LOW); delay(100); } } }