SparkFun 9DOF Block Programming Guide - SparkFun 9DOF Block(LSM9DS0 Programming Guide SparkFun 9DOF Block(LSM9DS0 Programming Guide 1 Table of Contents

SparkFun 9DOF Block Programming Guide - SparkFun 9DOF...

This preview shows page 1 - 5 out of 12 pages.

SparkFun®9DOF Block (LSM9DS0): Programming Guide 1 SparkFun®9DOF Block (LSM9DS0): Programming Guide
Background image
SparkFun®9DOF Block (LSM9DS0): Programming Guide 2 Table of Contents Introduction.....................................................................................................................3Things Needed ................................................................................................................3C Library Overview .........................................................................................................4Programming Guide .......................................................................................................5References ....................................................................................................................12Revision history VersionDateComment1.0 10/28/2015 Initial release
Background image
SparkFun®9DOF Block (LSM9DS0): Programming Guide 3 Introduction This document provides guidance on how to write a C program for Intel®Edison and SparkFun®9DOF Block. We have developed a C library for this sensor and the programming instructions utilize this library. It is important to note that you need to set up your Edison board as an access point before you proceed. In order to set up your Edison board as an access point, please refer to to . For SparkFun®9DOF Block hardware information and assembly instructions, please refer to -block-?_ga=1.219694809.1549320362.1444206960. Things Needed 1.An Intel® Edison 2.A SparkFun® 9DOF Block 3.A SparkFun® Battery Block or a Base Block 1.If you use a base block, you need a micro USB cable supply power.4.A PC or a Mac
Background image
SparkFun®9DOF Block (LSM9DS0): Programming Guide 4 C Library Overview The C library includes LSM9DS0.h and LSM9DS0.c. This provides useful functions for easy sensor configuration. The provided functions are the following: 1.accel_init, gyro_init, and mag_inita.accel_init: This function sets up an i2c connection between the Edison and the accelerometer/magnetometer. Then, it enables the sensor, sets the sample rate to 200Hz, and sets the scale to 2g. b.gyro_init: This function sets up an i2c connection between the Edison and the gyroscope. Then, it enables the sensor, sets the sample rate to 760Hz, and sets the scale to 245 dps. c.mag_init: This function sets up an i2c connection between the Edison and the accelerometer/magnetometer. Then, it enables the sensor, sets the sample rate to 100Hz, sets the scale to 2GS, and sets the sensor mode to continuous conversion mode. 2.calc_accel_res, calc_gyro_res, and calc_mag_resa.calc_accel_res: This function calculates g / (ADC tick). b.calc_gyro_res: This function calculates dps / (ADC tick). c.calc_mag_res: This function calculates GS / (ADC tick). 3.set_accel_ODR, set_gyro_ODR, and set_mag_ODRa.These functions set each sensor’s sample rate (Output Data Rate) to the user-specified value.
Background image
Image of page 5

You've reached the end of your free preview.

Want to read all 12 pages?

  • Winter '15
  • WilliamKaiser
  • ........., accel

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture