BLE Nano BT Serial


#1

Hi!

I’m new to BLE Nano, but have some Arduino background.

I am building a project around Nano, controlling some motors and servos.
I need a serial communication to PC or Android via Bluetooth.

The serial communication would suit me best, so I’d bind my Nano to PC as a wireless COM port and use it as a data stream.
But the examples I have found so far are not very helpful.
Maybe someone has already solved that problem?

Thanks.


#2

may be this program can help your problem…

Serial.println("onDataWritten : ");
if (Handler->handle == characteristic1.getValueAttribute().getHandle()) {
ble.readCharacteristicValue(characteristic1.getValueAttribute().getHandle(), buf, &bytesRead);
Serial.print(“bytesRead: “);
Serial.println(bytesRead, HEX);
for(index=0; index<bytesRead; index++) {
dataRcv += (char)buf[index];
}
Serial.println(””);
}

if(dataRcv==“a”) {
//Motor or Servo On
}
else if(dataRcv==“b”) {
//Motor or Servo Off
}

that program can be found in this function
void gattServerWriteCallBack(const GattWriteCallbackParams *Handler){}


#3

Unfortunately there is no ‘standard’ serial connection for BLE although Nordic Serial is a common one.

To help you get started, there is my free pfodDesigner app which will generate the BLE Nano code for you to set up a Nordic Serial connection to an Android mobile.

The pfodDesigner also lets you design menus and plots to display on your Android mobile using my (paid) pfodApp which connects to the Nano and other BLE, Bluetooth, Wifi and SMS devices.

Also see this tutorial on displaying graphic controls from your BLE Nano on your Android mobile, http://www.forward.com.au/pfod/BLE/RedbearNano/index.html