You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While rewriting library for myself I've discovered that there are tenths of degrees Celsius transmitted in low nibble of second temperature byte. It is encoded in BCD, so hex values are in range 00..09.
The text was updated successfully, but these errors were encountered:
Despite specified range 0..50 °C it can measure negative temperatures and have temperature granularity 0.1 °C. Temperature sign is stored in bit 7 of second temperature byte.
// 2nd temperature byte: tenths of temperature in low nibble in BCD.Temperature= (float) ((int16_t) Data[2] *10+ (Data[3] &0x0F)) / 10;
// 2nd temperature byte: bit 7 is temperature sign.if (Data[3] &0x80)
Temperature=-Temperature;
For DHT11
While rewriting library for myself I've discovered that there are tenths of degrees Celsius transmitted in low nibble of second temperature byte. It is encoded in BCD, so hex values are in range 00..09.
The text was updated successfully, but these errors were encountered: