Adafruit LIS2MDL Shield

Overview

The Adafruit LIS2MDL Triple-axis Magnetometer Sensor Shield features a ST LIS2MDL Magnetometer Sensor and two STEMMA QT connectors.

Adafruit LIS2MDL Shield

Adafruit LIS2MDL Shield (Credit: Adafruit)

Requirements

This shield can be used with boards which provide an I2C connector, for example STEMMA QT or Qwiic connectors. The target board must define a zephyr_i2c node label. See Shields for more details.

Pin Assignments

Shield Pin

Function

SDA

LIS2MDL I2C SDA

SCL

LIS2MDL I2C SCL

SDO

Not used in I2C mode

CS

Not used in I2C mode

See st,lis2mdl for documentation on devicetree settings.

Programming

Set --shield adafruit_lis2mdl when you invoke west build. For example when running the Magnetometer Sensor magnetometer sample:

# From the root of the zephyr repository
west build -b adafruit_qt_py_rp2040 --shield adafruit_lis2mdl samples/sensor/magn_polling