summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 6ccd3f4..c07b610 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);
+ result = (int16_t) ((1.0 * result * voltageRange / maxMillivolt) + 0.999);
return result;
}