Skip to content

Commit

Permalink
Merge pull request #24 from 42xnor/remove-accelrometer-sleep-calls
Browse files Browse the repository at this point in the history
Removed time.sleep() from accelrometer and magnometer reading methods.
  • Loading branch information
FoamyGuy authored Jul 15, 2024
2 parents d9b058a + e4e457b commit d566ca7
Showing 1 changed file with 2 additions and 5 deletions.
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

0 comments on commit d566ca7

Please sign in to comment.