33 #ifndef ERRIEZ_DHT22_H_ 34 #define ERRIEZ_DHT22_H_ 42 #define DHT22_MIN_READ_INTERVAL 2000 50 #define DHT22_NUM_DATA_BITS (5 * 8) 54 #define DEBUG_PRINTLN(...) { Serial.println(__VA_ARGS__); } 56 #define DEBUG_PRINTLN(...) {} 83 explicit DHT22(uint8_t pin);
84 void begin(uint8_t numSamples=0);
92 unsigned long _lastMeasurementTimestamp;
103 bool _statusLastMeasurement;
109 int16_t *_temperatureSamples;
111 uint8_t _temperatureSampleIndex;
113 uint8_t _numTemperatureSamples;
116 int16_t *_humiditySamples;
118 uint8_t _humiditySampleIndex;
120 uint8_t _numHumiditySamples;
132 bool generateStart();
134 uint32_t measurePulseWidth(uint8_t level);
137 #endif // ERRIEZ_DHT22_H_ int16_t readHumidity()
Read humidity from sensor.
void begin(uint8_t numSamples=0)
Initialize sensor.
#define DHT22_NUM_DATA_BITS
int16_t readTemperature()
Read temperature from sensor.
bool available()
Check if new temperature or humidity read is allowed.
DHT22(uint8_t pin)
Constructor DHT22 sensor.
bool readSensorData()
Read data from sensor.