9DoF Razor IMU M0 Hookup Guide

Contributors: jimblom
Favorited Favorite 7

Libraries and Example Firmware

In addition to the SAMD board definitions, the 9DoF Razor IMU M0's example firmware requires an additional library: the SparkFun MPU-9250 Digital Motion Processing (DMP) library. You can grab the MPU-9250-DMP library from GitHub, or by clicking the link below:

You'll also need the FlashStorage Arduino library installed on your machine. This library allows your SAMD21's excess flash memory to substitute for EEPROM -- giving it non-volatile memory so it can retain your serial commands.

The FlashStorage library is optional. Disable it by commenting out the ENABLE_NVRAM_STORAGE line in config.h. Without this library, settings that are changed will not be carried over on restart or power loss.

To install the libraries, unzip the ZIP files, and place the library folders into your Arduino sketchbook. For more help installing Arduino libraries, check out our Installing an Arduino Library tutorial.

Arduino libraries folder with FlashStorage and the MPU-9250-DMP library

After installing the libraries, open Arduino (or close and restart it if it was open).

Download and Upload the Example Firmware

The 9DoF Razor IMU M0's example firmware can be found in our 9DoF Razor GitHub repository. Or you can click the button below to download it.

The firmware includes a pair of files -- the standard .ino file with the main source, and a config.h file, which consists mostly of defines, which you can modify to quickly customize the firmware. Make sure both tabs are open in your Arduino IDE before attempting to compile and upload.

Razor IMU M0 Firmware in the Arduino IDE

If the config.h file isn’t present in your Arduino IDE, you can create a new tab (by clicking the down-arrow in the upper-right corner of the IDE) and copy/paste it in from here.

Once you've installed the libraries, loaded the code, and have the SparkFun 9DoF Razor M0 board selected, upload it to your board. You probably won't see any new behavior on your 9DoF Razor IMU, but it'll proof that you've got everything installed correctly.