|
20 | 20 | **Software and Dependencies:**
|
21 | 21 |
|
22 | 22 | * Adafruit CircuitPython firmware for the supported boards:
|
23 |
| - https://github.com/adafruit/circuitpython/releases |
| 23 | + https://circuitpython.org/downloads |
24 | 24 |
|
25 | 25 |
|
26 | 26 | * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
|
@@ -188,8 +188,34 @@ class OperationMode(CV):
|
188 | 188 |
|
189 | 189 | class LIS3MDL:
|
190 | 190 | """Driver for the LIS3MDL 3-axis magnetometer.
|
| 191 | +
|
191 | 192 | :param ~busio.I2C i2c_bus: The I2C bus the LIS3MDL is connected to.
|
192 |
| - :param address: The I2C slave address of the sensor |
| 193 | + :param address: The I2C device address. Defaults to :const:`0x1C` |
| 194 | +
|
| 195 | + **Quickstart: Importing and using the device** |
| 196 | +
|
| 197 | + Here is an example of using the :class:`LIS3MDL` class. |
| 198 | + First you will need to import the libraries to use the sensor |
| 199 | +
|
| 200 | + .. code-block:: python |
| 201 | +
|
| 202 | + import board |
| 203 | + import adafruit_lis3mdl |
| 204 | +
|
| 205 | + Once this is done you can define your `board.I2C` object and define your sensor object |
| 206 | +
|
| 207 | + .. code-block:: python |
| 208 | +
|
| 209 | + i2c = board.I2C() |
| 210 | + sensor = adafruit_lis3mdl.LIS3MDL(i2c) |
| 211 | +
|
| 212 | + Now you have access to the :attr:`magnetic` attribute |
| 213 | +
|
| 214 | + .. code-block:: python |
| 215 | +
|
| 216 | + mag_x, mag_y, mag_z = sensor.magnetic |
| 217 | +
|
| 218 | +
|
193 | 219 | """
|
194 | 220 |
|
195 | 221 | _chip_id = ROUnaryStruct(_LIS3MDL_WHOAMI, "<b")
|
@@ -279,7 +305,7 @@ def data_rate(self, value):
|
279 | 305 |
|
280 | 306 | @property
|
281 | 307 | def performance_mode(self):
|
282 |
| - """Sets the 'performance mode' of the sensor. Must be a `PerformanceMode`. |
| 308 | + """Sets the 'performance mode' of the sensor. Must be a ``PerformanceMode``. |
283 | 309 | Note that `performance_mode` affects the available data rate and will be
|
284 | 310 | automatically changed by setting ``data_rate`` to certain values."""
|
285 | 311 |
|
|
0 commit comments