HC05 - updated example
This commit is contained in:
parent
357408c3a6
commit
b772fc915d
1 changed files with 9 additions and 9 deletions
|
@ -1,10 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* KiteLib HC05 Example
|
KiteLib HC05 Example
|
||||||
*
|
|
||||||
* This example sends data using HC05 Bluetooth module.
|
This example sends data using HC05 Bluetooth module.
|
||||||
* HC05 works exactly like a Serial line, data are sent to the paired device.
|
HC05 works exactly like a Serial line, data are sent to the paired device.
|
||||||
* The default pairing code for HC05 is 1234.
|
The default pairing code for HC05 is 1234.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// include the library
|
// include the library
|
||||||
#include <KiteLib.h>
|
#include <KiteLib.h>
|
||||||
|
@ -23,12 +23,12 @@ void setup() {
|
||||||
void loop() {
|
void loop() {
|
||||||
// HC05 supports all methods of the Serial class
|
// HC05 supports all methods of the Serial class
|
||||||
// read data incoming from Serial port and write them to Bluetooth
|
// read data incoming from Serial port and write them to Bluetooth
|
||||||
while(Serial.available() > 0) {
|
while (Serial.available() > 0) {
|
||||||
bluetooth.write(Serial.read());
|
bluetooth.write(Serial.read());
|
||||||
}
|
}
|
||||||
|
|
||||||
// read data incoming from Bluetooth and write them to Serial port
|
// read data incoming from Bluetooth and write them to Serial port
|
||||||
while(bluetooth.available() > 0) {
|
while (bluetooth.available() > 0) {
|
||||||
Serial.write(bluetooth.read());
|
Serial.write(bluetooth.read());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue