RadioLibSmol/examples/JDY08/JDY08.ino
2018-07-16 19:13:24 +02:00

32 lines
677 B
C++

/*
* KiteLib JDY08 Example
*
* This example sends data using JDY08 Bluetooth module.
*/
// include the library
#include <KiteLib.h>
// JDY08 module is in slot A on the shield
JDY08 ble = Kite.ModuleA;
void setup() {
Serial.begin(9600);
// initialize JDY08
// baudrate: 9600 baud
ble.begin(9600);
}
void loop() {
// JDY08 supports all methods of the Serial class
// read data incoming from Serial port and write them to Bluetooth
while(Serial.available() > 0) {
bluetooth.write(Serial.read());
}
// read data incoming from Bluetooth and write them to Serial port
while(bluetooth.available() > 0) {
Serial.write(bluetooth.read());
}
}