library for AMS ENS210 temperature and humidity sensor
Dependents: rIoTwear-temp-humid
Diff: AMS_ENS210.cpp
- Revision:
- 2:f5a7883ae9c2
- Parent:
- 1:94a79c88c105
- Child:
- 3:3b427231e5a7
--- a/AMS_ENS210.cpp Tue Jan 17 14:26:34 2017 +0000 +++ b/AMS_ENS210.cpp Wed Jan 18 08:54:58 2017 +0000 @@ -139,7 +139,7 @@ i2c_read(SENS_TEMP, output, 3); // do crc7 - if (output[3] & 1) // bit 0 of byte 3 is the valid flag + if (output[2] & 1) // bit 0 of byte 3 is the valid flag reading = 0 | output[0] | (output[1] << 8); // bytes 1 and 2 make the 16 bit data } @@ -156,7 +156,7 @@ i2c_read(SENS_HUMID, output, 3); // do crc7 - if (output[3] & 1) // bit 0 of byte 3 is the valid flag + if (output[2] & 1) // bit 0 of byte 3 is the valid flag reading = 0 | output[0] | (output[1] << 8); // bytes 1 and 2 make the 16 bit data }