Skip to content

Commit 9e503e7

Browse files
authored
Merge pull request #28 from caternuson/iss26_continuous
Support continuous mode.
2 parents e439d7e + cf6cd50 commit 9e503e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_ads1x15/ads1x15.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
__version__ = "0.0.0-auto.0"
3232
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15.git"
3333

34-
import time
3534
from micropython import const
3635
from adafruit_bus_device.i2c_device import I2CDevice
3736

@@ -158,8 +157,9 @@ def _read(self, pin):
158157
config |= _ADS1X15_CONFIG_COMP_QUE_DISABLE
159158
self._write_register(_ADS1X15_POINTER_CONFIG, config)
160159

161-
while not self._conversion_complete():
162-
time.sleep(0.01)
160+
if self.mode == Mode.SINGLE:
161+
while not self._conversion_complete():
162+
pass
163163

164164
return self.get_last_result()
165165

0 commit comments

Comments
 (0)