<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to get acceleration values of x, y and z from raw data of Lis3dh?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84397/how-to-get-acceleration-values-of-x-y-and-z-from-raw-data-of-lis3dh</link><description>I had successfully interfaced lis3dh on nrf52 dev board using i2c protocol, i am getting raw values of x, y and z but i don&amp;#39;t know how to interpret those values i.e. convert them into acceleration (g), even not getting clear picture from datasheet. i</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Feb 2022 07:58:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84397/how-to-get-acceleration-values-of-x-y-and-z-from-raw-data-of-lis3dh" /><item><title>RE: How to get acceleration values of x, y and z from raw data of Lis3dh?</title><link>https://devzone.nordicsemi.com/thread/351235?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 07:58:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c873bbd-3313-4eda-be3d-5a07409ba708</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I&amp;#39;m no expert on the&amp;nbsp;lis3dh, but the datasheet says &amp;quot;±2g/±4g/±8g/±16g dynamically selectable full scale&amp;quot; and &amp;quot;16-bit data output&amp;quot; on the Features brief, and &amp;quot;The value is expressed as two’s complement left-justified.&amp;quot; from the register description of the output registers. Accellerometers are sampled with an ADC, so treat the raw data as an 16-bit int, that is left-shifted to msb. &lt;br /&gt;&lt;br /&gt;F.ex with +/-2g scale and 10 bit precicion the raw values will have a range of -1023 to + 1023, then you shift the raw value to your preferred precision and multiply it with&amp;nbsp;2 * 1G to get the G-value.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Take a look at this stackeoverflow&amp;nbsp;post:&amp;nbsp;&lt;a href="https://stackoverflow.com/questions/49467573/convert-twos-complement-left-justified-integer-into-regular-binary/50237543"&gt;https://stackoverflow.com/questions/49467573/convert-twos-complement-left-justified-integer-into-regular-binary/50237543&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>