summaryrefslogtreecommitdiffstats
path: root/src/ADS1115_WE.cpp
diff options
context:
space:
mode:
authorWolfgang (Wolle) Ewald <wolfgang.ewald@wolles-elektronikkiste.de>2020-07-02 14:42:17 +0200
committerGitHub <noreply@github.com>2020-07-02 14:42:17 +0200
commit45a28bb97499cba56468fea4b4c3e87d8b28b9ec (patch)
treec1a994680a163da4664714154ca967cee44f649e /src/ADS1115_WE.cpp
parentUpdate library.properties (diff)
downloadADS1115_WE-45a28bb97499cba56468fea4b4c3e87d8b28b9ec.tar
ADS1115_WE-45a28bb97499cba56468fea4b4c3e87d8b28b9ec.tar.gz
ADS1115_WE-45a28bb97499cba56468fea4b4c3e87d8b28b9ec.tar.bz2
ADS1115_WE-45a28bb97499cba56468fea4b4c3e87d8b28b9ec.tar.lz
ADS1115_WE-45a28bb97499cba56468fea4b4c3e87d8b28b9ec.tar.xz
ADS1115_WE-45a28bb97499cba56468fea4b4c3e87d8b28b9ec.tar.zst
ADS1115_WE-45a28bb97499cba56468fea4b4c3e87d8b28b9ec.zip
Diffstat (limited to '')
-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);