This tutorial will cover the basic operation of the BLE TinyShield using a standard TinyDuino and a Bluetooth-enabled device, such as a smartphone or tablet. To communicate with the stack, we will use the nRF UART v2.0 Android application and the nRF Connect iOS application. Click the link to download the application to your mobile device before starting the tutorial.
Once that is finished, we will start by adding files to our Arduino environment.
Click here to download STBLE.zip. You can also download this file by clicking the "Arduino Library and Example Code" link on the BLE TinyShield product page. After completing the download, open the Arduino IDE.
Select Sketch > Include Library > Add .ZIP Library. Navigate to your Downloads folder and select the folder STBLE.zip. Select "Open." The IDE should display a message that the library was added successfully.
Restart the Arduino IDE. Select File > Examples > STBLE > UARTPassThrough. This should open the code below.
With your TinyDuino plugged in and powered on, upload the code. Open the Serial Monitor and the nRF UART v2.0 application on your device. Enable Bluetooth connection.
Follow the images above to connect to the TinyDuino stack. The TinyShield will always appear as "BlueNRG." Once the two devices connect, your Serial Monitor should display something similar to the image below.
We'll start by sending a number to the application using the Serial Monitor. Type in '54' and press Send.
The application should display the message "RX: 54."
Now, we'll send to our TinyDuino the number in reverse. Type '45' into the application text box and tap Send.
The Serial Monitor should display the number 45. The number preceding it with a colon indicates the number of characters that were sent. Only 20 characters may be sent between the two devices.