Skip to content

Commit

Permalink
Merge pull request #19 from adafruit/dhct_dhcx
Browse files Browse the repository at this point in the history
fixing "DHCT" typo
  • Loading branch information
tannewt committed Jun 26, 2020
2 parents 2ffd1a0 + d8f652c commit 367dab4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Introduction
:target: https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS/actions
:alt: Build Status

CircuitPython library for the ST LSM6DSOX, LSM6DS33, and ISM330DHCT 6-dof Accelerometer and Gyros
CircuitPython library for the ST LSM6DSOX, LSM6DS33, and ISM330DHCX 6-dof Accelerometer and Gyros


Dependencies
Expand Down
12 changes: 6 additions & 6 deletions adafruit_lsm6ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
_LSM6DS_DEFAULT_ADDRESS = const(0x6A)

_LSM6DS_CHIP_ID = const(0x6C)
_ISM330DHCT_CHIP_ID = const(0x6B)
_ISM330DHCX_CHIP_ID = const(0x6B)
_LSM6DS33_CHIP_ID = const(0x69)

_LSM6DS_FUNC_CFG_ACCESS = const(0x1)
Expand Down Expand Up @@ -294,15 +294,15 @@ def accelerometer_range(self, value):
def gyro_range(self):
"""Adjusts the range of values that the sensor can measure, from 125 Degrees/second to 4000
degrees/s. Note that larger ranges will be less accurate. Must be a `GyroRange`. 4000 DPS
is only available for the ISM330DHCT"""
is only available for the ISM330DHCX"""
return self._cached_gyro_range

@gyro_range.setter
def gyro_range(self, value):
if not GyroRange.is_valid(value):
raise AttributeError("range must be a `GyroRange`")
if value is GyroRange.RANGE_4000_DPS and not isinstance(self, ISM330DHCT):
raise AttributeError("4000 DPS is only available for ISM330DHCT")
if value is GyroRange.RANGE_4000_DPS and not isinstance(self, ISM330DHCX):
raise AttributeError("4000 DPS is only available for ISM330DHCX")

if value is GyroRange.RANGE_125_DPS:
self._gyro_range_125dps = True
Expand Down Expand Up @@ -398,7 +398,7 @@ class LSM6DS33(LSM6DS): # pylint: disable=too-many-instance-attributes
CHIP_ID = _LSM6DS33_CHIP_ID


class ISM330DHCT(LSM6DS): # pylint: disable=too-many-instance-attributes
class ISM330DHCX(LSM6DS): # pylint: disable=too-many-instance-attributes

"""Driver for the LSM6DS33 6-axis accelerometer and gyroscope.
Expand All @@ -407,7 +407,7 @@ class ISM330DHCT(LSM6DS): # pylint: disable=too-many-instance-attributes
"""

CHIP_ID = _ISM330DHCT_CHIP_ID
CHIP_ID = _ISM330DHCX_CHIP_ID

def __init__(self, i2c_bus, address=_LSM6DS_DEFAULT_ADDRESS):
super().__init__(i2c_bus, address)
Expand Down
4 changes: 2 additions & 2 deletions examples/lsm6ds_full_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import busio

# pylint:disable=no-member,unused-import
from adafruit_lsm6ds import LSM6DS33, LSM6DSOX, ISM330DHCT, Rate, AccelRange, GyroRange
from adafruit_lsm6ds import LSM6DS33, LSM6DSOX, ISM330DHCX, Rate, AccelRange, GyroRange

i2c = busio.I2C(board.SCL, board.SDA)

sensor = LSM6DS33(i2c)
# sensor = LSM6DSOX(i2c)
# sensor = ISM330DHCT(i2c)
# sensor = ISM330DHCX(i2c)

sensor.accelerometer_range = AccelRange.RANGE_8G
print(
Expand Down
4 changes: 2 additions & 2 deletions examples/lsm6ds_ism330dhct_simpletest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import time
import board
import busio
from adafruit_lsm6ds import ISM330DHCT
from adafruit_lsm6ds import ISM330DHCX

i2c = busio.I2C(board.SCL, board.SDA)

sensor = ISM330DHCT(i2c)
sensor = ISM330DHCX(i2c)

while True:
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (sensor.acceleration))
Expand Down
4 changes: 2 additions & 2 deletions examples/lsm6ds_rate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import busio

# pylint:disable=no-member,unused-import
from adafruit_lsm6ds import LSM6DS33, LSM6DSOX, ISM330DHCT, Rate
from adafruit_lsm6ds import LSM6DS33, LSM6DSOX, ISM330DHCX, Rate

i2c = busio.I2C(board.SCL, board.SDA)

sensor = LSM6DS33(i2c)
# sensor = LSM6DSOX(i2c)
# sensor = ISM330DHCT(i2c)
# sensor = ISM330DHCX(i2c)

while True:
sensor.accelerometer_data_rate = Rate.RATE_12_5_HZ
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
name="adafruit-circuitpython-lsm6ds",
use_scm_version=True,
setup_requires=["setuptools_scm"],
description="CircuitPython library for the ST LSM6DSOX, LSM6DS33, and ISM330DHCT 6-DOF Accelerometer and Gyros",
description="CircuitPython library for the ST LSM6DSOX, LSM6DS33, and ISM330DHCX 6-DOF Accelerometer and Gyros",
long_description=long_description,
long_description_content_type="text/x-rst",
# The project's main homepage.
Expand All @@ -48,7 +48,7 @@
"Programming Language :: Python :: 3.5",
],
# What does your project relate to?
keywords="adafruit blinka circuitpython micropython lsm6ds lsm6dsox lsm6ds33 icm330dhct imu gyro gyroscope inemo"
keywords="adafruit blinka circuitpython micropython lsm6ds lsm6dsox lsm6ds33 icm330dhcx imu gyro gyroscope inemo"
"accelerometer",
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
Expand Down

0 comments on commit 367dab4

Please sign in to comment.