| 139 | |
| 140 | |
| 141 | uint16_t SHT::readStatus() |
| 142 | { |
| 143 | uint8_t status[3] = { 0, 0, 0 }; |
| 144 | // page 13 datasheet |
| 145 | if (writeCmd(SHT_READ_STATUS) == false) |
| 146 | { |
| 147 | return 0xFFFF; |
| 148 | } |
| 149 | // 16 bit status + CRC |
| 150 | if (readBytes(3, (uint8_t*) &status[0]) == false) |
| 151 | { |
| 152 | return 0xFFFF; |
| 153 | } |
| 154 | |
| 155 | if (status[2] != crc8(status, 2)) |
| 156 | { |
| 157 | _error = SHT_ERR_CRC_STATUS; |
| 158 | return 0xFFFF; |
| 159 | } |
| 160 | |
| 161 | return (uint16_t) (status[0] << 8) + status[1]; |
| 162 | } |
| 163 | |
| 164 | |
| 165 | bool SHT::reset(bool hard) |