From 27148f2c1380af75c05edb494bcecd394bfcb32d Mon Sep 17 00:00:00 2001 From: "Wolfgang (Wolle) Ewald" Date: Sat, 15 Aug 2020 12:22:25 +0200 Subject: Update ADS1115_WE.cpp --- src/ADS1115_WE.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3