RadioLib/examples/JDY08/JDY08.ino

33 wiersze
673 B
Arduino
Czysty Zwykły widok Historia

2018-07-14 14:12:19 +00:00
/*
2018-07-23 10:43:25 +00:00
KiteLib JDY08 Example
This example sends data using JDY08 Bluetooth module.
*/
2018-07-14 14:12:19 +00:00
// 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
2018-07-16 17:13:24 +00:00
// read data incoming from Serial port and write them to Bluetooth
2018-07-23 10:43:25 +00:00
while (Serial.available() > 0) {
2018-07-16 17:13:24 +00:00
bluetooth.write(Serial.read());
2018-07-14 14:12:19 +00:00
}
2018-07-23 10:43:25 +00:00
2018-07-16 17:13:24 +00:00
// read data incoming from Bluetooth and write them to Serial port
2018-07-23 10:43:25 +00:00
while (bluetooth.available() > 0) {
2018-07-16 17:13:24 +00:00
Serial.write(bluetooth.read());
2018-07-14 14:12:19 +00:00
}
}