From 45a28bb97499cba56468fea4b4c3e87d8b28b9ec Mon Sep 17 00:00:00 2001 From: "Wolfgang (Wolle) Ewald" Date: Thu, 2 Jul 2020 14:42:17 +0200 Subject: Add files via upload --- src/ADS1115_WE.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') 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); -- cgit v1.2.3