# LSM9DS1 Sample Code Question

**URL:** <https://community.sparkfun.com/t/lsm9ds1-sample-code-question/33753>\
**Category:** Projects\
**Created:** [January 4, 2017, 5:31pm UTC](https://community.sparkfun.com/t/lsm9ds1-sample-code-question/33753 "2017-01-04T17:31:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JVHooligan](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@JVHooligan](https://community.sparkfun.com/u/JVHooligan)\
**Post date:** [January 4, 2017, 5:31pm UTC](https://community.sparkfun.com/t/lsm9ds1-sample-code-question/33753/1 "2017-01-04T17:31:09Z")

</div>

Hello everyone,

I have a question about the sparkfun sample code written by Jim Lindblom @ SparkFun Electronics that I would like to discuss.

I built a Arduino based IMU using the sparkfun LSM9DS1, the SD shield and the Arduino UNO R3 for loggin flight data in rockets and other platforms. Here is a picture of the electronics:

![](http://s132.photobucket.com/user/soccer_hooligan2001/media/IMG_6694_zpsnozugnmu.jpg.html?sort=3&o=1)[http://s132.photobucket.com/user/soccer … sort=3&o=1](http://s132.photobucket.com/user/soccer_hooligan2001/media/IMG_6694_zpsnozugnmu.jpg.html?sort=3&o=1)

In the sample code the accelrometer dynamic range can be set in the line of code:

imu.settings.accel.scale = 16; // Set accel scale to +/-16g.

when I set the range to 2, 4, or 8 the acceleration measured when the IMU is ‘flat’ on a given axis the acceleration reads about 1 or - 1 which makes sense as it is being accelerated with 1 G of gravity. When I set it to 16 the acceleration is about 0.68. My question is does anyone know what is going on? Why is the acceleration not 1?

John
