summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ADS1115_WE.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/ADS1115_WE.cpp b/src/ADS1115_WE.cpp
index 700b3d0..dc3098b 100644
--- a/src/ADS1115_WE.cpp
+++ b/src/ADS1115_WE.cpp
@@ -120,11 +120,9 @@ void ADS1115_WE::setVoltageRange_mV(ADS1115_RANGE range){
alertLimit = (alertLimit/currentRange) * range;
writeRegister(ADS1115_HI_THRESH_REG, alertLimit);
- if(currentCompMode != ADS1115_MAX_LIMIT){
- int16_t alertLimit = readRegister(ADS1115_LO_THRESH_REG);
- alertLimit = (alertLimit/currentRange) * range;
- writeRegister(ADS1115_LO_THRESH_REG, alertLimit);
- }
+ alertLimit = readRegister(ADS1115_LO_THRESH_REG);
+ alertLimit = (alertLimit/currentRange) * range;
+ writeRegister(ADS1115_LO_THRESH_REG, alertLimit);
}
currentConfReg &= ~(0x0E00);