Pages: 1 [2]   Go Down
Author Topic: [LIB] Interrupt driven DHT11 Lib (idDHT11)  (Read 15033 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 47
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've added an example that use 2 sensor, please try it at
https://github.com/niesteszeck/idDHT11/tree/master/examples/idDHT11_Lib_2sensors_example

One problem with your example is that it doesn't check if the B sensor end acquiring. so maybe sometimes you could get error values.

The part that you said is for debugging, is only to know which error was causing a problem. you can erase it, but you should do something like this to be sure you receive a good measure

Code:
....
while (DHT11A.acquiring()) // check if first sensor has ended acquiring
    ;
int result = DHT11A.getStatus();
if(result != IDDHTLIB_OK)
   //HANDLE THE ERROR
   ...... 
} else {
   // DO WHATEVER YOU WANT with the data of the sensor
   ......
}

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you, that works like a charm.
Logged

Pages: 1 [2]   Go Up
Jump to: