Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improving docs and varia #12

Merged
merged 7 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ For use with the ICM20649:

import time
import board
import busio
import adafruit_icm20x

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA
icm = adafruit_icm20x.ICM20649(i2c)

while True:
Expand All @@ -80,10 +79,9 @@ For use with the ICM20948:

import time
import board
import busio
import adafruit_icm20x

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA
icm = adafruit_icm20x.ICM20948(i2c)

while True:
Expand Down
16 changes: 7 additions & 9 deletions adafruit_icm20x.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class ICM20X: # pylint:disable=too-many-instance-attributes
"""Library for the ST ICM-20X Wide-Range 6-DoF Accelerometer and Gyro Family


:param ~busio.I2C i2c_bus: The I2C bus the ICM20X is connected to.
:param ~board.I2C i2c_bus: The I2C bus the ICM20X is connected to.
jposada202020 marked this conversation as resolved.
Show resolved Hide resolved
:param int address: The I2C slave address of the sensor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the use of the word slave here to peripheral to match the CircuitPython Design Guide terminology.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do thanks :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will go back and correct this and all the busio designations in previous PRs. Thanks @kattni

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kattni I updated this according to your suggestion and will continue to use the design guide for the comments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is solved in 5c27ce9


"""
Expand Down Expand Up @@ -515,7 +515,7 @@ def _low_power(self, enabled):
class ICM20649(ICM20X):
"""Library for the ST ICM-20649 Wide-Range 6-DoF Accelerometer and Gyro.

:param ~busio.I2C i2c_bus: The I2C bus the ICM20649 is connected to.
:param ~board.I2C i2c_bus: The I2C bus the ICM20649 is connected to.
:param int address: The I2C slave address of the sensor. Defaults to :const:`0x68`

**Quickstart: Importing and using the ICM20649 temperature sensor**
Expand All @@ -525,15 +525,14 @@ class ICM20649(ICM20X):

.. code-block:: python

import busio
import board
import adafruit_icm20x

Once this is done you can define your `busio.I2C` object and define your sensor object
Once this is done you can define your `board.I2C` object and define your sensor object

.. code-block:: python

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA
icm = adafruit_icm20x.ICM20649(i2c)

Now you have access to the acceleration using :attr:`acceleration` attribute and
Expand Down Expand Up @@ -592,7 +591,7 @@ class MagDataRate(CV):
class ICM20948(ICM20X): # pylint:disable=too-many-instance-attributes
"""Library for the ST ICM-20948 Wide-Range 6-DoF Accelerometer and Gyro.

:param ~busio.I2C i2c_bus: The I2C bus the ICM20948 is connected to.
:param ~board.I2C i2c_bus: The I2C bus the ICM20948 is connected to.
:param int address: The I2C slave address of the sensor. Defaults to :const:`0x69`

**Quickstart: Importing and using the ICM20948 temperature sensor**
Expand All @@ -602,15 +601,14 @@ class ICM20948(ICM20X): # pylint:disable=too-many-instance-attributes

.. code-block:: python

import busio
import board
import adafruit_icm20x

Once this is done you can define your `busio.I2C` object and define your sensor object
Once this is done you can define your `board.I2C` object and define your sensor object

.. code-block:: python

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA
icm = adafruit_icm20x.ICM20948(i2c)

Now you have access to the acceleration using :attr:`acceleration` attribute,
Expand Down
3 changes: 1 addition & 2 deletions examples/icm20x_icm20649_full_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import time
import board
import busio
from adafruit_icm20x import ICM20649, AccelRange, GyroRange


Expand All @@ -15,7 +14,7 @@ def printNewMax(value, current_max, axis):


# pylint:disable=no-member
i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA

ism = ICM20649(i2c)

Expand Down
3 changes: 1 addition & 2 deletions examples/icm20x_icm20649_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

import time
import board
import busio
import adafruit_icm20x

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA
icm = adafruit_icm20x.ICM20649(i2c)

while True:
Expand Down
3 changes: 1 addition & 2 deletions examples/icm20x_icm20948_accel_data_rate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

import time
import board
import busio
from adafruit_icm20x import ICM20948

cycles = 200
i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA
icm = ICM20948(i2c)

# Cycle between two data rates
Expand Down
3 changes: 1 addition & 2 deletions examples/icm20x_icm20948_gyro_data_rate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

import time
import board
import busio
from adafruit_icm20x import ICM20948

cycles = 200
i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA
icm = ICM20948(i2c)

# Cycle between two data rates
Expand Down
3 changes: 1 addition & 2 deletions examples/icm20x_icm20948_mag_data_rate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
# pylint: disable=no-member
import time
import board
import busio
from adafruit_icm20x import MagDataRate, ICM20948

cycles = 200
i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA
icm = ICM20948(i2c)

# Cycle between two data rates
Expand Down
3 changes: 1 addition & 2 deletions examples/icm20x_icm20948_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

import time
import board
import busio
import adafruit_icm20x

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA
icm = adafruit_icm20x.ICM20948(i2c)

while True:
Expand Down