From ce3190f65c8710c8e6ed83c97ea055c2626339a1 Mon Sep 17 00:00:00 2001 From: Tony DiCola Date: Mon, 12 Oct 2015 18:37:54 -0700 Subject: [PATCH] Switch back to integer division in array indexing. --- DHT.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DHT.cpp b/DHT.cpp index 1d188bd..ec57de5 100644 --- a/DHT.cpp +++ b/DHT.cpp @@ -194,11 +194,11 @@ boolean DHT::read(bool force) { _lastresult = false; return _lastresult; } - data[i * 0.125] <<= 1; + data[i/8] <<= 1; // Now compare the low and high cycle times to see if the bit is a 0 or 1. if (highCycles > lowCycles) { // High cycles are greater than 50us low cycle count, must be a 1. - data[i * 0.125] |= 1; + data[i/8] |= 1; } // Else high cycles are less than (or equal to, a weird case) the 50us low // cycle count so this must be a zero. Nothing needs to be changed in the