From d6201ea20a9f7cbb4dbecae0f339b0742f27b3c2 Mon Sep 17 00:00:00 2001 From: caternuson Date: Thu, 7 Mar 2019 12:35:45 -0800 Subject: [PATCH 1/2] only check conversion in single mode --- adafruit_ads1x15/ads1x15.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/adafruit_ads1x15/ads1x15.py b/adafruit_ads1x15/ads1x15.py index 18dccb2..f16ba4c 100644 --- a/adafruit_ads1x15/ads1x15.py +++ b/adafruit_ads1x15/ads1x15.py @@ -158,8 +158,9 @@ def _read(self, pin): config |= _ADS1X15_CONFIG_COMP_QUE_DISABLE self._write_register(_ADS1X15_POINTER_CONFIG, config) - while not self._conversion_complete(): - time.sleep(0.01) + if self.mode == Mode.SINGLE: + while not self._conversion_complete(): + pass return self.get_last_result() From cf6cd5086502ad5ca4cc5565ff8ad4afda14923a Mon Sep 17 00:00:00 2001 From: caternuson Date: Thu, 7 Mar 2019 12:38:49 -0800 Subject: [PATCH 2/2] remove unused import --- adafruit_ads1x15/ads1x15.py | 1 - 1 file changed, 1 deletion(-) diff --git a/adafruit_ads1x15/ads1x15.py b/adafruit_ads1x15/ads1x15.py index f16ba4c..3e4f4eb 100644 --- a/adafruit_ads1x15/ads1x15.py +++ b/adafruit_ads1x15/ads1x15.py @@ -31,7 +31,6 @@ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15.git" -import time from micropython import const from adafruit_bus_device.i2c_device import I2CDevice