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

Removed time.sleep() from accelrometer and magnometer reading methods. #24

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Changes from all commits
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
7 changes: 2 additions & 5 deletions adafruit_icm20x.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ def acceleration(self):
"""The x, y, z acceleration values returned in a 3-tuple and are in :math:`m / s ^ 2.`"""
self._bank = 0
raw_accel_data = self._raw_accel_data
sleep(0.005)

x = self._scale_xl_data(raw_accel_data[0])
y = self._scale_xl_data(raw_accel_data[1])
Expand All @@ -287,7 +286,6 @@ def gyro(self):
return (x, y, z)

def _scale_xl_data(self, raw_measurement):
sleep(0.005)
return raw_measurement / AccelRange.lsb[self._cached_accel_range] * G_TO_ACCEL

def _scale_gyro_data(self, raw_measurement):
Expand Down Expand Up @@ -530,7 +528,7 @@ class ICM20649(ICM20X):
import board
import adafruit_icm20x

Once this is done you can define your `board.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

Expand Down Expand Up @@ -605,7 +603,7 @@ class ICM20948(ICM20X): # pylint:disable=too-many-instance-attributes
import board
import adafruit_icm20x

Once this is done you can define your `board.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

Expand Down Expand Up @@ -746,7 +744,6 @@ def magnetic(self):

self._bank = 0
full_data = self._raw_mag_data
sleep(0.005)

x = full_data[0] * _ICM20X_UT_PER_LSB
y = full_data[1] * _ICM20X_UT_PER_LSB
Expand Down
Loading