Introduction
============
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-lsm303dlh-mag/badge/?version=latest
:target: https://docs.circuitpython.org/projects/lsm303dlh-mag/en/latest/
:alt: Documentation Status
.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg
:target: https://adafru.it/discord
:alt: Discord
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag/workflows/Build%20CI/badge.svg
:target: https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag/actions/
:alt: Build Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black
Adafruit CircuitPython module for the LSM303DLH's 3-axis magnetometer
Note that this is specifically intended for the LSM303DLHC, as opposed to the
LSM303DLH proper, which has the magnetic Y and Z orientations swapped.
Dependencies
=============
This driver depends on:
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
Installing from PyPI
====================
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/adafruit-circuitpython-lsm303dlh_mag/>`_. To install for current user:
.. code-block:: shell
pip3 install adafruit-circuitpython-lsm303dlh_mag
To install system-wide (this may be required in some cases):
.. code-block:: shell
sudo pip3 install adafruit-circuitpython-lsm303dlh_mag
To install in a virtual environment in your current project:
.. code-block:: shell
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-lsm303dlh_mag
Usage Example
=============
.. code-block:: python3
import time
import board
import adafruit_lsm303dlh_mag
i2c = board.I2C() # uses board.SCL and board.SDA
sensor = adafruit_lsm303dlh_mag.LSM303DLH_Mag(i2c)
while True:
mag_x, mag_y, mag_z = sensor.magnetic
print('Magnetometer (gauss): ({0:10.3f}, {1:10.3f}, {2:10.3f})'.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 <https://docs.circuitpython.org/projects/lsm303dlh-mag/en/latest/>`_.
For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
Contributing
============
Contributions are welcome! Please read our `Code of Conduct
<https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag/blob/main/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.
Raw data
{
"_id": null,
"home_page": "",
"name": "adafruit-circuitpython-lsm303dlh-mag",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "adafruit,lsm303,6dof,6-dof,magnetometer,axisbreakout,hardware,micropython,circuitpython",
"author": "",
"author_email": "Adafruit Industries <circuitpython@adafruit.com>",
"download_url": "https://files.pythonhosted.org/packages/57/3f/a454dd064ef9ce2c579b7cfabee1e1bb323c12939d58e76f326f685befc7/adafruit-circuitpython-lsm303dlh-mag-1.1.19.tar.gz",
"platform": null,
"description": "\nIntroduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-lsm303dlh-mag/badge/?version=latest\n :target: https://docs.circuitpython.org/projects/lsm303dlh-mag/en/latest/\n :alt: Documentation Status\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n :target: https://adafru.it/discord\n :alt: Discord\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag/workflows/Build%20CI/badge.svg\n :target: https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag/actions/\n :alt: Build Status\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: Code Style: Black\n\nAdafruit CircuitPython module for the LSM303DLH's 3-axis magnetometer\n\nNote that this is specifically intended for the LSM303DLHC, as opposed to the\nLSM303DLH proper, which has the magnetic Y and Z orientations swapped.\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_\n* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.\n\nInstalling from PyPI\n====================\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI <https://pypi.org/project/adafruit-circuitpython-lsm303dlh_mag/>`_. To install for current user:\n\n.. code-block:: shell\n\n pip3 install adafruit-circuitpython-lsm303dlh_mag\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n sudo pip3 install adafruit-circuitpython-lsm303dlh_mag\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n mkdir project-name && cd project-name\n python3 -m venv .venv\n source .venv/bin/activate\n pip3 install adafruit-circuitpython-lsm303dlh_mag\n\nUsage Example\n=============\n\n.. code-block:: python3\n\n import time\n import board\n import adafruit_lsm303dlh_mag\n\n i2c = board.I2C() # uses board.SCL and board.SDA\n sensor = adafruit_lsm303dlh_mag.LSM303DLH_Mag(i2c)\n\n while True:\n mag_x, mag_y, mag_z = sensor.magnetic\n\n print('Magnetometer (gauss): ({0:10.3f}, {1:10.3f}, {2:10.3f})'.format(mag_x, mag_y, mag_z))\n print('')\n time.sleep(1.0)\n\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs <https://docs.circuitpython.org/projects/lsm303dlh-mag/en/latest/>`_.\n\nFor information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n<https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag/blob/main/CODE_OF_CONDUCT.md>`_\nbefore contributing to help this project stay welcoming.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "CircuitPython library for LSM303DLH's 3-axis magnetometer.",
"version": "1.1.19",
"project_urls": {
"Homepage": "https://github.com/adafruit/Adafruit_CircuitPython_LSM303DLH_Mag"
},
"split_keywords": [
"adafruit",
"lsm303",
"6dof",
"6-dof",
"magnetometer",
"axisbreakout",
"hardware",
"micropython",
"circuitpython"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7fac94903dd919a543e579112dae4659a46d7e6828c4b55afea75b089505fa02",
"md5": "e214c2d7d4846260e88373fe2367548d",
"sha256": "52f93402969f9a6cd707ff61c7eaeaa9bbeb33000bb5e1d728b4d48fc8d6608d"
},
"downloads": -1,
"filename": "adafruit_circuitpython_lsm303dlh_mag-1.1.19-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e214c2d7d4846260e88373fe2367548d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6185,
"upload_time": "2023-05-26T16:26:21",
"upload_time_iso_8601": "2023-05-26T16:26:21.670015Z",
"url": "https://files.pythonhosted.org/packages/7f/ac/94903dd919a543e579112dae4659a46d7e6828c4b55afea75b089505fa02/adafruit_circuitpython_lsm303dlh_mag-1.1.19-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "573fa454dd064ef9ce2c579b7cfabee1e1bb323c12939d58e76f326f685befc7",
"md5": "b2b008e9eb4e67ca0f0b48f6c421ccf1",
"sha256": "da7a07d0e53851a159e753576f141a85c5b9e26e468b44e2ced363316a9094c9"
},
"downloads": -1,
"filename": "adafruit-circuitpython-lsm303dlh-mag-1.1.19.tar.gz",
"has_sig": false,
"md5_digest": "b2b008e9eb4e67ca0f0b48f6c421ccf1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 27619,
"upload_time": "2023-05-26T16:26:24",
"upload_time_iso_8601": "2023-05-26T16:26:24.169973Z",
"url": "https://files.pythonhosted.org/packages/57/3f/a454dd064ef9ce2c579b7cfabee1e1bb323c12939d58e76f326f685befc7/adafruit-circuitpython-lsm303dlh-mag-1.1.19.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-26 16:26:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adafruit",
"github_project": "Adafruit_CircuitPython_LSM303DLH_Mag",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "adafruit-circuitpython-lsm303dlh-mag"
}