Skip to main content

CircuitPython helper library for the LIS3MDL 3-axis magnetometer

Project description

Introduction

Documentation Status Discord Build Status Code Style: Ruff

CircuitPython helper library for the LIS3MDL 3-axis magnetometer

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-lis3mdl

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-lis3mdl

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-lis3mdl

Usage Example

import time
import board
import adafruit_lis3mdl

i2c = board.I2C()  # uses board.SCL and board.SDA
sensor = adafruit_lis3mdl.LIS3MDL(i2c)

while True:
    mag_x, mag_y, mag_z = sensor.magnetic

    print('X:{0:10.2f}, Y:{1:10.2f}, Z:{2:10.2f} uT'.format(mag_x, mag_y, mag_z))
    print('')
    time.sleep(1.0)

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adafruit_circuitpython_lis3mdl-1.2.7.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file adafruit_circuitpython_lis3mdl-1.2.7.tar.gz.

File metadata

File hashes

Hashes for adafruit_circuitpython_lis3mdl-1.2.7.tar.gz
Algorithm Hash digest
SHA256 4e01c4f934732d19867ad892c39fc69227940188d0ec5dd5e33abd8024d982ab
MD5 58f3d5c0328f681306fdfd36956045f6
BLAKE2b-256 bb14d3e4002fa7f365e0bd4a463426645a918008968dbe7b7a7699e93be5c2bd

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_lis3mdl-1.2.7-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_lis3mdl-1.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 298cdd0fd042a4e83b8fd0dc6c4a530bbae5dee64f2550ad63c431cd95d06f01
MD5 515ee5b7a8611c32d6d2093ef1780c95
BLAKE2b-256 e1210ee89087c198000f025e9c9a5078c6e79b1101040275bb059ee908f9f941

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page