Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 11 months ago.
wait(1);
Hi,
In the readData function, there is a comment says wait 500uS forDHT22 and wait(1) is used
// only 500uS for DHT22 but 18ms for DHT11 (_DHTtype == 11) ? wait_ms(18) : wait(1);
I am confused of what wait(1) means, wait 1 second or wait mS!
Here (https://developer.mbed.org/handbook/Wait) it says wait() is in seconds. But the code in DHT.cpp meant 1mS
Please advise
Question relating to:
1 Answer
8 years, 11 months ago.
You are reading the code correctly, it's waiting 18ms for a DHT11 and 1 second for everything else.
Assuming the comment is correct it should be safe to change that to wait_ms(1) or even wait_us(500)