Switch back to integer division in array indexing.

This commit is contained in:
Tony DiCola 2015-10-12 18:37:54 -07:00
parent 5bc0a5c796
commit ce3190f65c

View File

@ -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