6 #ifndef __SENSORS_DHT11_h__
7 #define __SENSORS_DHT11_h__
15 template <
int DATAPIN,
int TYPE=DHT11,u
int8_t MAXMEASURE=1>
19 Dht () : _dht(DATAPIN,TYPE) {}
25 bool measure (__attribute__((unused))
bool async=
false) {
27 if( present() ==
true ) {
28 uint8_t measure=MAXMEASURE;
29 while( success ==
false && measure > 0 ) {
31 float t = _dht.readTemperature(
false,
true);
32 float h = _dht.readHumidity();
33 if( isnan(t) ==
false && isnan(h) ==
false ) {
34 _temperature = t * 10;
38 else if( measure > 0 ) {