Sentinel
Loading...
Searching...
No Matches
dht22.h
Go to the documentation of this file.
1
9
10#ifndef SENSORS_DHT22
11#define SENSORS_DHT22
12
13#include "config.h"
14#include <Arduino.h>
15#include <DHT.h>
16
24
25class SensorDHT
26{
27private:
28 DHT dht;
29 float temperature;
30 float humidity;
31
32public:
33 SensorDHT(uint8_t pin) : dht(pin, DHT22) {}
34
35 void begin();
36 void update();
37
38 float getTemperature() const;
39 float getHumdity() const;
40};
41
42#endif
float getHumdity() const
Get the humidity value.
Definition dht22.cpp:55
void begin()
Constructor for the SensorDHT class.
Definition dht22.cpp:21
float getTemperature() const
Get the temperature value.
Definition dht22.cpp:45
void update()
Update the temperature and humidity values.
Definition dht22.cpp:33
Configuration Header File.