mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 10:00:36 +01:00
Add delay to aht10.cpp (#1498)
This commit is contained in:
parent
4030a2e253
commit
29fc4af0fc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user