Library for the ADS1015 and ADS1115 ADCS
Fork of ADS1015 by
Diff: Adafruit_ADS1015.cpp
- Revision:
- 13:e0d3c07d79fa
- Parent:
- 12:b8485d232bf8
- Child:
- 14:e8dd6dcf64e9
--- a/Adafruit_ADS1015.cpp Thu Feb 01 18:03:39 2018 +0000 +++ b/Adafruit_ADS1015.cpp Wed May 16 08:24:51 2018 +0000 @@ -164,7 +164,7 @@ positive or negative. */ /**************************************************************************/ -int16_t Adafruit_ADS1015::readADC_Differential_0_1() +int16_t Adafruit_ADS1015::readADC_Differential_0_3() { // Start with default values uint16_t config = ADS1015_REG_CONFIG_CQUE_NONE | // Disable the comparator (default val) @@ -178,7 +178,7 @@ config |= m_gain; // Set channels - config |= ADS1015_REG_CONFIG_MUX_DIFF_0_1; // AIN0 = P, AIN1 = N + config |= ADS1015_REG_CONFIG_MUX_DIFF_0_3; // AIN0 = P, AIN1 = N // Set 'start single-conversion' bit config |= ADS1015_REG_CONFIG_OS_SINGLE; @@ -212,7 +212,7 @@ positive or negative. */ /**************************************************************************/ -int16_t Adafruit_ADS1015::readADC_Differential_2_3() +int16_t Adafruit_ADS1015::readADC_Differential_1_3() { // Start with default values uint16_t config = ADS1015_REG_CONFIG_CQUE_NONE | // Disable the comparator (default val) @@ -226,7 +226,7 @@ config |= m_gain; // Set channels - config |= ADS1015_REG_CONFIG_MUX_DIFF_2_3; // AIN2 = P, AIN3 = N + config |= ADS1015_REG_CONFIG_MUX_DIFF_1_3; // AIN0 = P, AIN1 = N // Set 'start single-conversion' bit config |= ADS1015_REG_CONFIG_OS_SINGLE; @@ -235,7 +235,7 @@ writeRegister(m_i2cAddress, ADS1015_REG_POINTER_CONFIG, config); // Wait for the conversion to complete - wait_ms(m_conversionDelay); + wait_us(m_conversionDelay); // Read the conversion results uint16_t res = readRegister(m_i2cAddress, ADS1015_REG_POINTER_CONVERT) >> m_bitShift; @@ -251,7 +251,6 @@ return (int16_t)res; } } - /**************************************************************************/ /*! @brief Sets up the comparator to operate in basic mode, causing the