I2C: Accelerometer

Learn the I2C protocol by reading the physical orientation using an accelerometer.

This tour will give an introduction into using I2C devices, using the LIS3DH accelerometer. This is a cheap and low-power accelerometer that is used on a lot of prototyping boards. It explains how to connect to an accelerometer and how to read its values.

Officially these are called I²C devices, but for simplicitly we’re using I2C for readability and searchability instead.


Get started with I2C

Get started with the LIS3DH by verifying the connection.

Configuring the accelerometer

Turn on the accelerometer and start reading values

Reading acceleration values

Read the X, Y, and Z values from the accelerometer.