summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWolfgang (Wolle) Ewald <wolfgang.ewald@wolles-elektronikkiste.de>2020-08-15 12:22:25 +0200
committerGitHub <noreply@github.com>2020-08-15 12:22:25 +0200
commit27148f2c1380af75c05edb494bcecd394bfcb32d (patch)
treec09330befc2038dd60ab1a2b0d095f5fb1aee670 /src
parentUpdate library.properties (diff)
downloadADS1115_WE-27148f2c1380af75c05edb494bcecd394bfcb32d.tar
ADS1115_WE-27148f2c1380af75c05edb494bcecd394bfcb32d.tar.gz
ADS1115_WE-27148f2c1380af75c05edb494bcecd394bfcb32d.tar.bz2
ADS1115_WE-27148f2c1380af75c05edb494bcecd394bfcb32d.tar.lz
ADS1115_WE-27148f2c1380af75c05edb494bcecd394bfcb32d.tar.xz
ADS1115_WE-27148f2c1380af75c05edb494bcecd394bfcb32d.tar.zst
ADS1115_WE-27148f2c1380af75c05edb494bcecd394bfcb32d.zip
Diffstat (limited to 'src')
-rw-r--r--src/ADS1115_WE.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ADS1115_WE.cpp b/src/ADS1115_WE.cpp
index c07b610..5a6b164 100644
--- a/src/ADS1115_WE.cpp
+++ b/src/ADS1115_WE.cpp
@@ -179,7 +179,7 @@ int16_t ADS1115_WE::getResultWithRange(int16_t min, int16_t max, int16_t maxMill
int16_t rawResult = readRegister(ADS1115_CONV_REG);
int16_t result = 0;
result = map(rawResult, -32767, 32767, min, max);
- result = (int16_t) ((1.0 * result * voltageRange / maxMillivolt) + 0.999);
+ result = (int16_t) ((1.0 * result * voltageRange / maxMillivolt) + 0.5);
return result;
}