Add delay to aht10.cpp (#1498)

This commit is contained in:
krunkel authored and GitHub committed 2021-05-12 15:50:26 +12:00
1 parent 4030a2e253
commit 29fc4af0fc
1 file changed
+1
+1
View File
@@ -60,6 +60,7 @@ void AHT10Component::update() {
delay = AHT10_HUMIDITY_DELAY;
for (int i = 0; i < AHT10_ATTEMPS; ++i) {
ESP_LOGVV(TAG, "Attemps %u at %6ld", i, millis());
delay_microseconds_accurate(4);
if (!this->read_bytes(0, data, 6, delay)) {
ESP_LOGD(TAG, "Communication with AHT10 failed, waiting...");
} else if ((data[0] & 0x80) == 0x80) { // Bit[7] = 0b1, device is busy