Module f3::lsm303dlhc [] [src]

LSM303DLHC - Accelerometer + Magnetometer

This sensor is connected to the I2C bus via these pins:

  • Clock (SCL) pin - PB6
  • Data (SDA) pin - PB7

Accelerometer

  • Sample rate: 400 Hz
  • Input range: [-8g, +8g]
  • Gain: 8 mg / LSB
  • Output range: 16 bits (i16)

Magnetometer

  • Sample rate: 15 Hz
  • Input range: [-1.3G, +1.3G]
  • Gain X, Y: 1100 LSB / Gauss
  • Gain Z: 980 LSB / Gauss
  • Output range: 12 bits ([-2048, +2047])

Functions

acceleration

Reads the acceleration

init

Initializes the LSM303DLHC

magnetic_field

Reads the magnetic field