Go Down

Topic: [LIB] Interrupt driven DHT11 Lib (idDHT11) (Read 41482 times) previous topic - next topic

niesteszeck

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: [Select]

....
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
   ......
}


Tero521


petoulachi

#17
Dec 04, 2015, 09:33 am Last Edit: Dec 04, 2015, 09:41 am by petoulachi
Hello,

I'm trying to use idDHTLib with a DHT22 on a Pro 5V, using port 3 on the Pro (and therefore interrupt number 1).
But I cannot read any value, everytime I've got a CheckSum error.

Any idea of what I'm doing wrong ?


Regards,

edit : ok my very bad, I do not noticed I had to change the callback method. Sorry !

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy