1
- # The MIT License (MIT)
1
+ # SPDX-FileCopyrightText: 2020 Bryan Siepert for Adafruit Industries
2
2
#
3
- # Copyright (c) 2020 Bryan Siepert for Adafruit Industries
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # SPDX-License-Identifier: MIT
4
+
22
5
"""
23
6
`adafruit_lis331`
24
7
================================================================================
@@ -277,17 +260,17 @@ def hpf_reference(self):
277
260
``use_reference`` must be set to true when enabling the high-pass filter. The value
278
261
is a signed 8-bit number from -128 to 127. The value of each increment of 1 depends on the
279
262
currently set measurement range and is approximate:
280
-
281
- +-------------------------------------------------------------+-------------------------------+
282
- | Range | Incremental value (LSB value) |
283
- +-------------------------------------------------------------+-------------------------------+
284
- | ``LIS331HHRange.RANGE_6G`` or ``H3LIS331Range.RANGE_100G`` | ~16mg |
285
- +-------------------------------------------------------------+-------------------------------+
286
- | ``LIS331HHRange.RANGE_12G`` or ``H3LIS331Range.RANGE_200G`` | ~31mg |
287
- +-------------------------------------------------------------+-------------------------------+
288
- | ``LIS331HHRange.RANGE_24G`` or ``H3LIS331Range.RANGE_400G`` | ~63mg |
289
- +-------------------------------------------------------------+-------------------------------+
290
-
263
+ #pylint: disable=line-too-long
264
+ +-------------------------------------------------------------+-------------------------------+
265
+ | Range | Incremental value (LSB value) |
266
+ +-------------------------------------------------------------+-------------------------------+
267
+ | ``LIS331HHRange.RANGE_6G`` or ``H3LIS331Range.RANGE_100G`` | ~16mg |
268
+ +-------------------------------------------------------------+-------------------------------+
269
+ | ``LIS331HHRange.RANGE_12G`` or ``H3LIS331Range.RANGE_200G`` | ~31mg |
270
+ +-------------------------------------------------------------+-------------------------------+
271
+ | ``LIS331HHRange.RANGE_24G`` or ``H3LIS331Range.RANGE_400G`` | ~63mg |
272
+ +-------------------------------------------------------------+-------------------------------+
273
+ #pylint: enable=line-too-long
291
274
"""
292
275
293
276
return self ._reference_value
@@ -365,7 +348,7 @@ def _mode_and_rate(self, data_rate=None):
365
348
@property
366
349
def range (self ):
367
350
"""Adjusts the range of values that the sensor can measure, Note that larger ranges will be
368
- less accurate. Must be a `H3LIS331Range` or `LIS331HHRange` """
351
+ less accurate. Must be a `H3LIS331Range` or `LIS331HHRange`"""
369
352
return self ._range_bits
370
353
371
354
@range .setter
@@ -401,8 +384,8 @@ def _scale_acceleration(self, value):
401
384
class LIS331HH (LIS331 ):
402
385
"""Driver for the LIS331HH 3-axis high-g accelerometer.
403
386
404
- :param ~busio.I2C i2c_bus: The I2C bus the LIS331 is connected to.
405
- :param address: The I2C slave address of the sensor
387
+ :param ~busio.I2C i2c_bus: The I2C bus the LIS331 is connected to.
388
+ :param address: The I2C slave address of the sensor
406
389
407
390
"""
408
391
@@ -417,8 +400,8 @@ def __init__(self, i2c_bus, address=_LIS331_DEFAULT_ADDRESS):
417
400
class H3LIS331 (LIS331 ):
418
401
"""Driver for the H3LIS331 3-axis high-g accelerometer.
419
402
420
- :param ~busio.I2C i2c_bus: The I2C bus the LIS331 is connected to.
421
- :param address: The I2C slave address of the sensor
403
+ :param ~busio.I2C i2c_bus: The I2C bus the LIS331 is connected to.
404
+ :param address: The I2C slave address of the sensor
422
405
423
406
"""
424
407
0 commit comments