AHTXX_START_MEASUREMENT_CTRL
Closed this issue · 1 comments
markusschweitzer commented
Hi,
for me (in the default configuration) readTemperature() and readHumidity() takes ~ 80ms each.
I experimented a little bit with the AHTXX_START_MEASUREMENT_CTRL value. 0xFF seems to really speed up measurement.
How have you found the 0x33 value? It seems kind of undocumented...
Have you also tried to use other values here? 0xFF seems to work pretty well.
best regards
enjoyneering commented
Use the macro AHTXX_USE_READ_DATA on the second read. This saves time because the temperature reading is already in the library buffer after the humidity reading. Change this code to the code below.
float humi1 = aht10.readHumidity(AHTXX_FORCE_READ_DATA); //AHTXX_FORCE_READ_DATA=read 6-bytes via I2C, takes 80 milliseconds
float temp1 = aht10.readTemperature(AHTXX_USE_READ_DATA); //AHTXX_USE_READ_DATA=use 6-bytes from humidity reading, takes zero milliseconds!!!
The 0x33 is from AHT20 datasheet v1.0 May 2021 & from AHT10 datasheet v1.2