Skip to content

Commit d566ca7

Browse files
authored
Merge pull request #24 from 42xnor/remove-accelrometer-sleep-calls
Removed time.sleep() from accelrometer and magnometer reading methods.
2 parents d9b058a + e4e457b commit d566ca7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

adafruit_icm20x.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ def acceleration(self):
266266
"""The x, y, z acceleration values returned in a 3-tuple and are in :math:`m / s ^ 2.`"""
267267
self._bank = 0
268268
raw_accel_data = self._raw_accel_data
269-
sleep(0.005)
270269

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

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

293291
def _scale_gyro_data(self, raw_measurement):
@@ -530,7 +528,7 @@ class ICM20649(ICM20X):
530528
import board
531529
import adafruit_icm20x
532530
533-
Once this is done you can define your `board.I2C` object and define your sensor object
531+
Once this is done you can define your ``board.I2C`` object and define your sensor object
534532
535533
.. code-block:: python
536534
@@ -605,7 +603,7 @@ class ICM20948(ICM20X): # pylint:disable=too-many-instance-attributes
605603
import board
606604
import adafruit_icm20x
607605
608-
Once this is done you can define your `board.I2C` object and define your sensor object
606+
Once this is done you can define your ``board.I2C`` object and define your sensor object
609607
610608
.. code-block:: python
611609
@@ -746,7 +744,6 @@ def magnetic(self):
746744

747745
self._bank = 0
748746
full_data = self._raw_mag_data
749-
sleep(0.005)
750747

751748
x = full_data[0] * _ICM20X_UT_PER_LSB
752749
y = full_data[1] * _ICM20X_UT_PER_LSB

0 commit comments

Comments
 (0)