# Setting up an Arduino or compatible microcontroller as a Firmata device

**URL:** <https://mworks.discourse.group/t/setting-up-an-arduino-or-compatible-microcontroller-as-a-firmata-device/57>\
**Category:** I/O Devices\
**Created:** [August 18, 2020, 7:24pm UTC](https://mworks.discourse.group/t/setting-up-an-arduino-or-compatible-microcontroller-as-a-firmata-device/57 "2020-08-18T19:24:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 18, 2020, 7:24pm UTC](https://mworks.discourse.group/t/setting-up-an-arduino-or-compatible-microcontroller-as-a-firmata-device/57/1 "2020-08-18T19:24:11Z")

</div>

In order to be used with MWorks’ [Firmata interface](https://mworks.github.io/documentation/latest/components/firmata_device.html), an [Arduino](https://www.arduino.cc) board or Arduino-compatible device must first be configured to support the [Firmata protocol](https://github.com/firmata/protocol). To do this, follow these steps:

1. [Install](https://www.arduino.cc/en/Guide/MacOSX) and launch the Arduino IDE.

2. (Optional, but recommended) For full compatibility with all features of MWorks’ Firmata interface, install the latest version of the Firmata library with MWorks extensions: [Download](https://github.com/mworks/mworks-firmata-arduino/archive/master.zip) and decompress the source code, change the name of the source folder to “Firmata”, and move it to `$HOME/Documents/Arduino/libraries`.

3. Connect the board to your computer via its USB cable.

4. Go to Tools → Board, and select the board you’re using. If you don’t see your board listed, you may need to [install a core](https://www.arduino.cc/en/Guide/Cores) for it.

5. Under Tools → Port, select the port that has your board’s name next to it in parentheses.

6. The next step depends on how you’ll be connecting to your board from the machine running MWorks. If you’ll be…

7. Click the “Upload” button (rightward-pointing arrow). This will compile and upload the StandardFirmata or StandardFirmataBLE code to your board.

8. Disconnect the board from your computer, and quit the Arduino IDE.

At this point, your board should be ready to use as a Firmata device. To test it, reconnect it to your computer via its USB cable, and try running the [Firmata blink](https://mworks.discourse.group/uploads/short-url/zfAEQdBbjwCZPLl7cR7KzCVwjfd.zip) demo experiment. This experiment toggles the state of digital pin 13 (typically connected to a built-in LED) every 500ms. If you’re connecting via BLE, be sure to set the value of the macro `bluetooth_local_name` to the string you used as `FIRMATA_BLE_LOCAL_NAME` in `bleConfig.h`.

If you run into problems at any point, have a look at the [Instructables Firmata tutorial](https://www.instructables.com/id/Arduino-Installing-Standard-Firmata/), which goes in to more detail on the various steps, or [get in touch](https://mworks.discourse.group/c/support/5).

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 20, 2022, 4:03pm UTC](https://mworks.discourse.group/t/setting-up-an-arduino-or-compatible-microcontroller-as-a-firmata-device/57/2 "2022-07-20T16:03:43Z")

</div>


