summaryrefslogtreecommitdiffstats
path: root/src/ADS1115_WE.cpp
diff options
context:
space:
mode:
authordavidcliddell <david@liddell.com>2021-04-15 12:01:48 +0200
committerdavidcliddell <david@liddell.com>2021-04-15 12:01:48 +0200
commit3ef38d91b0474ea0fa6e92b3e179911816277fc4 (patch)
treedd78c75944a2a3b8b9522a9292e68e785626da45 /src/ADS1115_WE.cpp
parentUpdate library.properties (diff)
downloadADS1115_WE-3ef38d91b0474ea0fa6e92b3e179911816277fc4.tar
ADS1115_WE-3ef38d91b0474ea0fa6e92b3e179911816277fc4.tar.gz
ADS1115_WE-3ef38d91b0474ea0fa6e92b3e179911816277fc4.tar.bz2
ADS1115_WE-3ef38d91b0474ea0fa6e92b3e179911816277fc4.tar.lz
ADS1115_WE-3ef38d91b0474ea0fa6e92b3e179911816277fc4.tar.xz
ADS1115_WE-3ef38d91b0474ea0fa6e92b3e179911816277fc4.tar.zst
ADS1115_WE-3ef38d91b0474ea0fa6e92b3e179911816277fc4.zip
Diffstat (limited to '')
-rw-r--r--src/ADS1115_WE.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ADS1115_WE.cpp b/src/ADS1115_WE.cpp
index debe73a..01cb4fa 100644
--- a/src/ADS1115_WE.cpp
+++ b/src/ADS1115_WE.cpp
@@ -218,7 +218,13 @@ void ADS1115_WE::setCompareChannels(ADS1115_MUX mux){
delayAccToRate(rate);
}
}
-
+
+void ADS1115_WE::setSingleChannel(size_t channel) {
+ if (channel >= 4)
+ return;
+ setCompareChannels((ADS1115_MUX)(ADS1115_COMP_0_GND + ADS1115_COMP_INC*channel));
+}
+
bool ADS1115_WE::isBusy(){
uint16_t currentConfReg = readRegister(ADS1115_CONFIG_REG);
return (!(currentConfReg>>15) & 1);