I'm working with nrf52 dk to read the sensor dht22. i need to follow this steps to make sure the sensor is ready to send data.
- Wait until DHT responds and pulls the line to LOW after around 40 micro-seconds or else exit as timeout error.
- Next, check for 80us LOW followed by 80us HIGH from DHT. This condition denotes that DHT is ready to send data next.
- Now, check for 50us LOW followed by 26us to 28us HIGH denoting data bit ‘0’ or 50us LOW followed 70us HIGH denoting data bit ‘1’. Store the interpreted bit in an array. Repeat this for each of 40 bits.
I don't understand how i should do a simple counter to count the time and convert to micro seconds.
It's my first experience with nordic, can anyone give me some tips?
Thank you.