Getting Started with the Artemis Development Kit

Pages
Favorited Favorite 0

Arduino Examples

Blink

With full Arduino support, users will be able to implement the built-in examples of the Arduino IDE on the Artemis DK. To begin, let's start with the most basic example: Blink.

  1. From the drop down file menu, pull up the Blink sketch:

select blink example
Screen shot of the Blink example in the Arduino IDE. (Click to enlarge)

  1. Since users will need the compiled binary code in order to program the Artemis DK, save this example somewhere that is easily accessible; the desktop is a good option. (*Remember to use Save As, so that you retain the original example within the Arduino IDE.)

save example to desktop
Blink example being saved to the Desktop. (Click to enlarge)

  1. Next, you will want to select the Artemis Dev Kit board from the tools drop down menu: Tools > Board: > Artemis Dev Kit

select artemis dk board
Selecting Artemis DK board definition in the Arduino IDE. (Click to enlarge)

  1. Finally, you will need to acquire the compiled binary code using the sketch drop down menu: Sketch > Export compiled Binary (Ctrl + Alt + S)

exporting binary file
Process for exporting the compiled binary from the Arduino IDE. (Click to enlarge)

  1. Now, the compiled binary will be located in the same location that the example was saved, from the previous step.

binary file
Screen shot of compiled binary in the example folder. (Click to enlarge)

  1. All that is left is to drag and drop (or copy) the compiled binary file into the mass storage device for the Artemis DK. The interface chip will take care of the rest.

drag and drop programming
Programming the Artemis DK. (Click to enlarge)

  1. The storage drive will automatically eject once the programming is complete. To verify that the board is working and that the programming was successful, users should see the STAT LED blinking in a ~1 sec. interval.

LED Blinking
A demonstration of the STAT LED blinking. (Click to enlarge)

Hello World

In this example, users will create their own sketch, compile and export the binary file, program the Artemis DK, and view the serial communication in a terminal emulator. (*Most of the steps below are illustrated the procedure of the previous example.)

  1. Open a new sketch in the Arduino IDE from the drop down file menu: File > New.
  2. Copy the example code below into the sketch:

    language:c
    // the setup routine runs once when you press reset:
    void setup() {
      // initialize serial communication at 9600 bits per second:
      Serial.begin(9600);
    }
    
    // the loop routine runs over and over again forever:
    void loop() {
      // print out "Hello World"
      Serial.println("Hello World");
      delay(500);
    }
    
  3. Save the sketch (File > Save As...) using the file drop down menu.

  4. Select the then, export the compiled binary code (Sketch > Export compiled Binary) using the sketch drop down menu.
  5. Drag and drop (or copy) the binary .bin file into the ARTEMIS mass storage drive. The storage drive will automatically eject once the programming is complete.
  6. 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.

serial output
A demonstration of the board's serial communication. (Click to enlarge)

Bluetooth: LED

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.

  1. From the drop down file menu, open the LED sketch: File > Examples > ArduinoBLE > Peripheral > LED.
  2. Save the sketch (File > Save As...) using the file drop down menu.
  3. Select the then, export the compiled binary code (Sketch > Export compiled Binary) using the sketch drop down menu.
  4. Drag and drop (or copy) the binary .bin file into the ARTEMIS mass storage drive. The storage drive will automatically eject once the programming is complete.
  5. 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.
  6. Click the reset button to begin the program. Users should see a BLE LED Peripheral message in the terminal emulator.
  7. Follow the steps and video below to control the STAT LED on the Artemis DK.
    1. Unlock the phone and enable the Bluetooth.
    2. Open the NRF app.
    3. Click on the Scan button on the upper right corner.
    4. 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.
    5. Once connected, locate the Unknown Service. It will have the following service UUID: 19B10000-E8F2-537E-4F6C-D104768A1214.
    6. Click on the service. Then, locate and click on the upload button (up arrow).
    7. 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, an LED on or LED 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.

Utilizing the example with the NRF phone app.

bluetooth serial output
Serial output of the LED Bluetooth example. (Click to enlarge)

More Advanced Examples and Features

For more advanced examples and features of the Artemis DK with the Arduino IDE, check out the Arduino IDE software development tutorial. We also just released a blog post on streaming data over Bluetooth to a computer.

Artemis Development with Arduino

June 20, 2019

Get our powerful Artemis based boards (Artemis Nano, BlackBoard Artemis, and BlackBoard Artemis ATP) blinking in less than 5 minutes using the SparkFun Artemis Arduino Core!

Additionally, since the Arduino core for the Artemis module is built upon the Mbed™ OS, the API can also be utilized within the Arduino IDE. For more information, check out the Mbed™ software development tutorial.

Artemis Development on Arm® Mbed™ OS (Beta)

September 10, 2020

With the latest Artemis DK, board, we now offer full Bluetooth support within the Arduino IDE and development with Mbed™ OS. While we have worked tirelessly to get the Artemis module supported in the next Mbed™ OS release, the next release isn't slated until after the Artemis DK becomes available to the public. Therefore, this post will provide users with a jump start for developing with Mbed™ Studio, prior to the next release (in a beta of sorts), by utilizing our fork of Mbed™ OS.

Note:The tutorial for Mbed™ is in progress, pending the next Mbed™ release. In the meantime, users can check out the tutorial above for beta testing with our fork of Mbed™ OS.