diff options
author | Wolfgang (Wolle) Ewald <wolfgang.ewald@wolles-elektronikkiste.de> | 2021-04-06 23:22:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 23:22:04 +0200 |
commit | fabc983abe9bc0ce4ee0f366464996beb83079fd (patch) | |
tree | 7300e61293bd8bfdfcd3c5291770f06693e83224 | |
parent | Update README.md (diff) | |
download | ADS1115_WE-fabc983abe9bc0ce4ee0f366464996beb83079fd.tar ADS1115_WE-fabc983abe9bc0ce4ee0f366464996beb83079fd.tar.gz ADS1115_WE-fabc983abe9bc0ce4ee0f366464996beb83079fd.tar.bz2 ADS1115_WE-fabc983abe9bc0ce4ee0f366464996beb83079fd.tar.lz ADS1115_WE-fabc983abe9bc0ce4ee0f366464996beb83079fd.tar.xz ADS1115_WE-fabc983abe9bc0ce4ee0f366464996beb83079fd.tar.zst ADS1115_WE-fabc983abe9bc0ce4ee0f366464996beb83079fd.zip |
-rw-r--r-- | src/ADS1115_WE.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ADS1115_WE.cpp b/src/ADS1115_WE.cpp index d9547ad..3b3be9c 100644 --- a/src/ADS1115_WE.cpp +++ b/src/ADS1115_WE.cpp @@ -139,17 +139,18 @@ void ADS1115_WE::setVoltageRange_mV(ADS1115_RANGE range){ currentConfReg &= ~(0x0E00);
currentConfReg |= range;
writeRegister(ADS1115_CONFIG_REG, currentConfReg);
+ convRate rate = getConvRate();
+ delayAccToRate(rate);
}
void ADS1115_WE::setAutoRange(){
uint16_t currentConfReg = readRegister(ADS1115_CONFIG_REG);
- convRate rate = getConvRate();
setVoltageRange_mV(ADS1115_RANGE_6144);
- delayAccToRate(rate);
if(deviceMeasureMode == ADS1115_SINGLE){
setMeasureMode(ADS1115_CONTINUOUS);
- delayAccToRate(rate);
+ convRate rate = getConvRate();
+ delayAccToRate(rate);
}
float result = abs(getResult_mV());
@@ -172,8 +173,7 @@ void ADS1115_WE::setAutoRange(){ }
writeRegister(ADS1115_CONFIG_REG, currentConfReg);
- setVoltageRange_mV(optRange);
- delayAccToRate(rate);
+ setVoltageRange_mV(optRange);
}
void ADS1115_WE::delayAccToRate(convRate cr){
|