Skip to content

Commit ae01e1e

Browse files
committed
Rename to use the name of the actual sensor
1 parent aa324bc commit ae01e1e

File tree

9 files changed

+45
-45
lines changed

9 files changed

+45
-45
lines changed

README.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
Introduction
33
============
44

5-
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-lsm303agr-mag/badge/?version=latest
6-
:target: https://circuitpython.readthedocs.io/projects/lsm303agr-mag/en/latest/
5+
.. image:: https://readthedocs.org/projects/adafruit-circuitpython-lis2mdl-mag/badge/?version=latest
6+
:target: https://circuitpython.readthedocs.io/projects/lis2mdl-mag/en/latest/
77
:alt: Documentation Status
88

99
.. image :: https://img.shields.io/discord/327254708534116352.svg
1010
:target: https://discord.gg/nBQh6qu
1111
:alt: Discord
1212
13-
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_LSM303AGR_Mag/workflows/Build%20CI/badge.svg
14-
:target: https://github.com/adafruit/Adafruit_CircuitPython_LSM303AGR_Mag/actions/
13+
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL/workflows/Build%20CI/badge.svg
14+
:target: https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL/actions/
1515
:alt: Build Status
1616

17-
Adafruit CircuitPython module for the LSM303AGR's 3-axis magnetometer
17+
Adafruit CircuitPython module for the LIS2MDL 3-axis magnetometer
1818

1919
Dependencies
2020
=============
@@ -32,17 +32,17 @@ Installing from PyPI
3232
====================
3333

3434
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
35-
PyPI <https://pypi.org/project/adafruit-circuitpython-lsm303agr_mag/>`_. To install for current user:
35+
PyPI <https://pypi.org/project/adafruit-circuitpython-lis2mdl/>`_. To install for current user:
3636

3737
.. code-block:: shell
3838
39-
pip3 install adafruit-circuitpython-lsm303agr_mag
39+
pip3 install adafruit-circuitpython-lis2mdl
4040
4141
To install system-wide (this may be required in some cases):
4242

4343
.. code-block:: shell
4444
45-
sudo pip3 install adafruit-circuitpython-lsm303agr_mag
45+
sudo pip3 install adafruit-circuitpython-lis2mdl
4646
4747
To install in a virtual environment in your current project:
4848

@@ -51,7 +51,7 @@ To install in a virtual environment in your current project:
5151
mkdir project-name && cd project-name
5252
python3 -m venv .env
5353
source .env/bin/activate
54-
pip3 install adafruit-circuitpython-lsm303agr_mag
54+
pip3 install adafruit-circuitpython-lis2mdl
5555
5656
Usage Example
5757
=============
@@ -61,10 +61,10 @@ Usage Example
6161
import time
6262
import board
6363
import busio
64-
import adafruit_lsm303agr_mag
64+
import adafruit_lis2mdl
6565
6666
i2c = busio.I2C(board.SCL, board.SDA)
67-
sensor = adafruit_lsm303agr_mag.LSM303AGR_Mag(i2c)
67+
sensor = adafruit_lis2mdl.LIS2MDL(i2c)
6868
6969
while True:
7070
mag_x, mag_y, mag_z = sensor.magnetic
@@ -78,7 +78,7 @@ Contributing
7878
============
7979

8080
Contributions are welcome! Please read our `Code of Conduct
81-
<https://github.com/adafruit/Adafruit_CircuitPython_LSM303AGR_Mag/blob/master/CODE_OF_CONDUCT.md>`_
81+
<https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL/blob/master/CODE_OF_CONDUCT.md>`_
8282
before contributing to help this project stay welcoming.
8383

8484
Documentation

adafruit_lsm303agr_mag.py renamed to adafruit_lis2mdl.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
# THE SOFTWARE.
2222
"""
23-
`adafruit_lsm303agr_mag`
23+
`adafruit_lis2mdl`
2424
====================================================
2525
2626
27-
CircuitPython driver for the LSM303AGR's magnetometer.
27+
CircuitPython driver for the LIS2MDL 3-axis magnetometer.
2828
2929
* Author(s): Bryan Siepert
3030
@@ -57,7 +57,7 @@
5757

5858

5959
__version__ = "0.0.0-auto.0"
60-
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_LSM303DHL_Mag.git"
60+
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL.git"
6161

6262
# pylint: disable=bad-whitespace
6363
_ADDRESS_MAG = const(0x1E) # (0x3C >> 1) // 0011110x
@@ -103,11 +103,11 @@ class DataRate: # pylint: disable=too-few-public-methods
103103

104104
_MAG_SCALE = 0.15 # 1.5 milligauss/LSB * 0.1 microtesla/milligauss
105105

106-
class LSM303AGR_Mag:# pylint: disable=too-many-instance-attributes
106+
class LIS2MDL:# pylint: disable=too-many-instance-attributes
107107
"""
108-
Driver for the Driver for the LSM303AGR's 'magnetometer.
108+
Driver for the LIS2MDL 3-axis magnetometer.
109109
110-
:param busio.I2C i2c_bus: The I2C bus the LSM303AGR is connected to.
110+
:param busio.I2C i2c_bus: The I2C bus the LIS2MDL is connected to.
111111
112112
"""
113113
_BUFFER = bytearray(6)
@@ -156,7 +156,7 @@ def __init__(self, i2c):
156156
self.i2c_device = I2CDevice(i2c, _ADDRESS_MAG)
157157

158158
if self._device_id != 0x40:
159-
raise AttributeError("Cannot find an LSM303AGR")
159+
raise AttributeError("Cannot find an LIS2MDL")
160160

161161
self.reset()
162162

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
.. If you created a package, create one automodule per module in the package.
33
4-
.. automodule:: adafruit_lsm303agr_mag
4+
.. automodule:: adafruit_lis2mdl
55
:members:

docs/conf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
master_doc = 'index'
3232

3333
# General information about the project.
34-
project = u'Adafruit LSM303AGR Magnetometer Library'
34+
project = u'Adafruit LIS2MDL 3-axis Magnetometer Library'
3535
copyright = u'2019 Bryan Siepert'
3636
author = u'Bryan Siepert'
3737

@@ -105,7 +105,7 @@
105105
html_favicon = '_static/favicon.ico'
106106

107107
# Output file base name for HTML help builder.
108-
htmlhelp_basename = 'AdafruitLsm303AgrMagLibrarydoc'
108+
htmlhelp_basename = 'AdafruitLIS2MDLLibrarydoc'
109109

110110
# -- Options for LaTeX output ---------------------------------------------
111111

@@ -131,7 +131,7 @@
131131
# (source start file, target name, title,
132132
# author, documentclass [howto, manual, or own class]).
133133
latex_documents = [
134-
(master_doc, 'AdafruitLSM303AGRMagLibrary.tex', u'Adafruit LSM303AGR Magnetometer Library Documentation',
134+
(master_doc, 'AdafruitLIS2MDLLibrary.tex', u'Adafruit LIS2MDL 3-axis Magnetometer Library Documentation',
135135
author, 'manual'),
136136
]
137137

@@ -140,7 +140,7 @@
140140
# One entry per manual page. List of tuples
141141
# (source start file, name, description, authors, manual section).
142142
man_pages = [
143-
(master_doc, 'AdafruitLSM303AGRMaglibrary', u'Adafruit LSM303AGR Magnetometer Library Documentation',
143+
(master_doc, 'AdafruitLIS2MDLlibrary', u'Adafruit LIS2MDL 3-axis Magnetometer Library Documentation',
144144
[author], 1)
145145
]
146146

@@ -150,7 +150,7 @@
150150
# (source start file, target name, title, author,
151151
# dir menu entry, description, category)
152152
texinfo_documents = [
153-
(master_doc, 'AdafruitLSM303AGRMagLibrary', u'Adafruit LSM303AGR Magnetometer Library Documentation',
154-
author, 'AdafruitLSM303AGRMAgLibrary', 'One line description of project.',
153+
(master_doc, 'AdafruitLIS2MDLLibrary', u'Adafruit LIS2MDL 3-axis Magnetometer Library Documentation',
154+
author, 'AdafruitLIS2MDLLibrary', 'One line description of project.',
155155
'Miscellaneous'),
156156
]

docs/examples.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Simple tests
33

44
Ensure your device works with these simple tests.
55

6-
.. literalinclude:: ../examples/lsm303agr_mag_simpletest.py
7-
:caption: examples/lsm303agr_mag_simpletest.py
6+
.. literalinclude:: ../examples/lis2mdl_simpletest.py
7+
:caption: examples/lis2mdl_simpletest.py
88
:linenos:
99

10-
.. literalinclude:: ../examples/lsm303agr_mag_interrupt.py
11-
:caption: examples/lsm303agr_mag_interrupt.py
10+
.. literalinclude:: ../examples/lis2mdl_interrupt.py
11+
:caption: examples/lis2mdl_interrupt.py
1212
:linenos:
1313

14-
examples/lsm303agr_mag_interrupt.py
14+
examples/lis2mdl_interrupt.py

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Table of Contents
3232
.. toctree::
3333
:caption: Other Links
3434

35-
Download <https://github.com/adafruit/Adafruit_CircuitPython_LSM303AGR_Mag/releases/latest>
35+
Download <https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL/releases/latest>
3636
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io>
3737
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
3838
Discord Chat <https://adafru.it/discord>

examples/lsm303agr_mag_interrupt.py renamed to examples/lis2mdl_interrupt.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import time
22
import board
33
import busio
4-
import adafruit_lsm303agr_mag
4+
import adafruit_lis2mdl
55

66
i2c = busio.I2C(board.SCL, board.SDA)
7-
lsm_mag = adafruit_lsm303agr_mag.LSM303AGR_Mag(i2c)
8-
lsm_mag.interrupt_threshold = 80
9-
lsm_mag.interrupt_enabled = True
7+
lis = adafruit_lis2mdl.LIS2MDL(i2c)
8+
lis.interrupt_threshold = 80
9+
lis.interrupt_enabled = True
1010

1111
while True:
12-
x_hi, y_hi, z_hi, x_lo, y_lo, z_lo, int_triggered = lsm_mag.faults
12+
x_hi, y_hi, z_hi, x_lo, y_lo, z_lo, int_triggered = lis.faults
1313

14-
print(lsm_mag.magnetic)
14+
print(lis.magnetic)
1515
print("Xhi:%s\tYhi:%s\tZhi:%s"%(x_hi, y_hi, z_hi))
1616
print("Xlo:%s\tYlo:%s\tZlo:%s"%(x_lo, y_lo, z_lo))
1717
print("Int triggered: %s"%int_triggered)

examples/lsm303agr_mag_simpletest.py renamed to examples/lis2mdl_simpletest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import time
44
import board
55
import busio
6-
import adafruit_lsm303agr_mag
6+
import adafruit_lis2mdl
77

88
i2c = busio.I2C(board.SCL, board.SDA)
9-
sensor = adafruit_lsm303agr_mag.LSM303AGR_Mag(i2c)
9+
sensor = adafruit_lis2mdl.LIS2MDL(i2c)
1010

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

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
long_description = f.read()
1919

2020
setup(
21-
name='adafruit-circuitpython-lsm303agr-mag',
21+
name='adafruit-circuitpython-lis2mdl',
2222

2323
use_scm_version=True,
2424
setup_requires=['setuptools_scm'],
2525

26-
description='CircuitPython library for LSM303AGR\'s 3-axis magnetometer.',
26+
description='CircuitPython library for LIS2MDL 3-axis magnetometer.',
2727
long_description=long_description,
2828
long_description_content_type='text/x-rst',
2929

3030
# The project's main homepage.
31-
url='https://github.com/adafruit/Adafruit_CircuitPython_LSM303AGR_Mag',
31+
url='https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL',
3232

3333
# Author details
3434
author='Adafruit Industries',
@@ -52,10 +52,10 @@
5252
],
5353

5454
# What does your project relate to?
55-
keywords='adafruit lsm303 6dof 6-dof magnetometer axis'
55+
keywords='adafruit lsm303 lis2mdl 3-dof 3-axis 6dof 6-dof magnetometer axis'
5656
'breakout hardware micropython circuitpython',
5757

5858
# You can just specify the packages manually here if your project is
5959
# simple. Or you can use find_packages().
60-
py_modules=['adafruit_lsm303agr_mag'],
60+
py_modules=['adafruit_lis2mdl'],
6161
)

0 commit comments

Comments
 (0)