The Arduino 101 came out recently, and it has built-in "Bluetooth Low Energy" capabilities. The tutorials and code examples that can be found for the 101 all seem to be about transmitting data, but I can't find anything about receiving data. I've tried to go through the source code of the CurieBle library to find some hints, but I feel a little overwhelmed/lost. Could someone point me to a code example which demonstrates how to do this?
Context: I was previously using an HC-05 module paired with an Arduino Nano in order to receive data. In this case it is quite easy to connect the HC-05 to the Nano's digital pins and receive data like so:
#define RxD 7 // This is the pin that the Bluetooth (BT_TX)
// will transmit to the Arduino (RxD)
#define TxD 8 // This is the pin that the Bluetooth (BT_RX)
// will receive from the Arduino (TxD)
SoftwareSerial blueToothSerial(RxD,TxD);
void setup() {
blueToothSerial.begin(9600);
Serial.begin(9600);
// Allow Serial communication via USB cable to computer
pinMode(RxD, INPUT);
// Set up the Arduino to receive INPUT from the HC-05 on Digital Pin 7
pinMode(TxD, OUTPUT);
// Set up the Arduino to send OUTPUT to the HC-05 on Digital Pin 8
}
void loop() {
char recvChar;
while(1) {
if(blueToothSerial.available()) {
recvChar = blueToothSerial.read();
Serial.print("Read character: ");
Serial.println(recvChar);
// Print the character received to the Serial Monitor
}
}
}
Is there equivalent, and equally simple, code available, which would do the same thing via the BLE built into the Arduino 101?