The goal of this chapter is to measure acceleration with the LSM303AGR, a three-axis accelerometer, and to use what it measures to compute how far the sensor is tilted, the same computation your phone does when it decides to rotate its screen. The sensor is an I2C (Inter-Integrated Circuit) device, so everything we built in Chapter 10 carries over: we will wire it to the STM32C031C6’s I2C bus, verify the link, look at what is inside the sensor, and complete a device driver for it. Section 12.6 collects the register map, the data-format arithmetic, and the floating-point details for looking up later.