forked from RoboCraft/Bluetooth_HC05
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
unknown
authored and
unknown
committed
Sep 1, 2015
1 parent
10652ce
commit 2e3f25e
Showing
7 changed files
with
119 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.pioenvs/ | ||
.cproject | ||
.project | ||
.sconsign.dblite | ||
platformio.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
Library for using HC-05 bluetooth module with Arduino. It saves yor time by abstracting you from AT-commands, which control the module, with class Bluetooth_HC05 and it's methods. Of course it adds some overhead to your firmware, but it's the price you pay for great convinience of getting the things done with several method calls rather than writing a parser for large AT-command set. | ||
#Bluetooth HC05 Arduino Library | ||
|
||
A fork of the work originally done by Artem Borisovskiy ([email protected]), http://robocraft.ru | ||
|
||
I've updated with a few minor tweaks and fixes. | ||
|
||
Library is designed for HC-05 bluetooth module with Arduino. It saves yor time by abstracting you from AT-commands, which control the module, with class Bluetooth_HC05 and it's methods. Of course it adds some overhead to your firmware, but it's the price you pay for great convinience of getting the things done with several method calls rather than writing a parser for large AT-command set. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <SoftwareSerial.h> | ||
#include "Bluetooth_HC05.h" | ||
|
||
SoftwareSerial bt_serial(6, 5); | ||
Bluetooth_HC05 hc05(bt_serial); | ||
|
||
void bluetoothDeviceFound(const BluetoothAddress &address) { | ||
Serial.print(F("Device Found: ")); | ||
char address_str[HC05_ADDRESS_BUFSIZE]; | ||
hc05.printBluetoothAddress(address_str,address,','); | ||
Serial.println(address_str); | ||
} | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
Serial.println(F("Callback HC05 Demo")); | ||
/* Speed: 38400; HC-05 MODE (PIO11): pin 7 */ | ||
hc05.begin(38400, 7, HC05_MODE_COMMAND); | ||
/* Wait until HC-05 starts */ | ||
delay(2000); | ||
/* Allow HC-05 to initiate connections */ | ||
hc05.setRole(HC05_ROLE_MASTER); | ||
/* Set pwd of HC-05 to all zeros */ | ||
hc05.setPassword("0000"); | ||
/* Cannot connect without this */ | ||
hc05.initSerialPortProfile(); | ||
/* set mode, num devices and time 5 * 1.28 seconds */ | ||
hc05.setInquiryMode(HC05_INQUIRY_RSSI, 9, 5); | ||
/* Inquiring does take a bit of time, thus 10 seconds of timeout. */ | ||
hc05.inquire(bluetoothDeviceFound, 10000); | ||
} | ||
|
||
void loop() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html | ||
|
||
This directory is intended for the project specific (private) libraries. | ||
PlatformIO will compile them to static libraries and link to executable file. | ||
|
||
The source code of each library should be placed in separate directory. | ||
For example, "lib/private_lib/[here are source files]". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters