Most people understand the basic concept behind UART (one channel to transmit data and one to receive it), so this felt like the easiest way to provide flexible, bi-directional communication between an Arduino and any BLE-enabled mobile platform, without painting people into the corner. BLE does have the capability to handle more complicated structured
data, but for the vast majority of people doing projects, UART will get you very very far.
To save everyone the headache of defining and working with custom services, we've wrapped up all of the low level BLE code into a single, easy to use class called Adafruit_BLE_UART
, available in the nRF8001 / Adafruit_BLE_UART repository on Github
Download the ZIP file by clicking on the button above, uncompress and rename the folder to Adafruit_BLE_UART
. Make sure it contains Adafruit_BLE_UART.cpp
. Then place the Adafruit_BLE_UART
your Arduino libraries
folder and restart the Arduino IDE. If this is
all unfamiliar, we have a tutorial introducing Arduino library concepts and installation
Restart the Arduino IDE and then open the 'uart' example via the 'File > Examples > Adafruit_BLE_UART> echoDemo ' menu item. (The library was renamed from Adafruit_nRF8001 to avoid confusion with the underlying library so the screenshot above is mismatched)
If you upload the demo to your wired-up Arduino and open the serial monitor you should see that it starts advertising BLE signal
Next up we will use our iOS or Android device to make the other side of the connection!
This guide was first published on Mar 20, 2014. It was last
updated on Sep 19, 2018.
This page (Software: UART Service) was last updated on Nov 20, 2015.