Artemis Development with the Arduino IDE
Contributors:
santaimpersonator, Liquid Soulder, Member #1571936
Bluetooth: LED
Install BLE Library
For users interested in the BLE functionality of the Apollo3 and Artemis boards, we have provided full support to the Arduino BLE library. Additional details about the library can be referenced from the documentation provided by Arduino.
Users who haven't already done so, will need to install the Arduino BLE library to continue with this example; please use the guide below, to get started with installing the Arduino BLE library:
Installing an Arduino Library
January 11, 2013
How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.
Peripheral LED Example
Note: Users will need to download the NRF Connect app onto their phone. We highly recommend utilizing an Android phone as we have had difficulties with device connections in the app for Apple phones.
As in the prior examples, these steps will follow a similar procedure.
- From the drop down file menu, open the LED sketch: File > Examples > ArduinoBLE > Peripheral > LED.
- Save the sketch (File > Save As...) using the file drop down menu.
- Select the then, export the compiled binary code (Sketch > Export compiled Binary) using the sketch drop down menu.
- Drag and drop (or copy) the binary
.bin
file into theARTEMIS
mass storage drive. The storage drive will automatically eject once the programming is complete. - To verify that the board is working and that the programming was successful, open a terminal emulator, such as TeraTerm or the Serial Monitor in the Arduino IDE. Connect to the serial port for the Artemis DK; don't forget to set the baud rate to 9600 bps.
- Click the reset button to begin the program. Users should see a
BLE LED Peripheral
message in the terminal emulator. - Follow the steps and video below to control the
STAT
LED on the Artemis DK.- Unlock the phone and enable the Bluetooth.
- Open the NRF app.
- Click on the Scan button on the upper right corner.
- In the results, locate the device labeled
LED
. Click on the CONNECT button to the right of the device name.- In the terminal emulator, users should see a
Connected to central:
message followed by the mac address of the phone.
- In the terminal emulator, users should see a
- Once connected, locate the
Unknown Service
. It will have the following service UUID:19B10000-E8F2-537E-4F6C-D104768A1214
. - Click on the service. Then, locate and click on the upload button (up arrow).
- A dialog box will open. We want to write a value, so locate the
New Value
text field, under the Write value drop-down menu option. Based on the control inputs to the LED, anLED on
orLED off
message will appear in the terminal emulator.- Enter
01
to turn the LED on. Then click the SEND button. - Enter
00
to turn the LED off. Then click the SEND button.
- Enter