pinMode(TxD, OUTPUT);
setupBleConnection();
}
void
loop()
{
char
recvChar;
while(1){
if(BLE.available()){//check if there's any data sent from the
remote BLE
recvChar
Serial.print(recvChar);
}
if(Serial.available()){//check if there's any data sent from the
local serial terminal, you can add the other applications here
recvChar
BLE.print(recvChar);
}
}
}
void
setupBleConnection()
{
BLE.begin(9600);
BLE.print("AT+CLEAR");
BLE.print("AT+ROLE0");
BLE.print("AT+SAVE1");
}
4.2
Demo : BLE Master
#include <SoftwareSerial.h>
#define RxD 2
#define TxD 3
#define DEBUG_ENABLED 1
SoftwareSerial
BLE(RxD,TxD);
void
setup()
{
Serial.begin(9600);
= BLE.read();
= Serial.read();
//Set BLE BaudRate to default baud rate 9600
//clear all previous setting
//set the bluetooth name as a slaver
//don't save the connect information
//Software Serial Port
8
Need help?
Do you have a question about the Grove - BLE and is the answer not in the manual?