Sentinel
Loading...
Searching...
No Matches
SensorDHT Class Reference

Class for the DHT22 sensor. More...

#include <dht22.h>

Public Member Functions

 SensorDHT (uint8_t pin)
 
void begin ()
 Constructor for the SensorDHT class.
 
void update ()
 Update the temperature and humidity values.
 
float getTemperature () const
 Get the temperature value.
 
float getHumdity () const
 Get the humidity value.
 

Detailed Description

Class for the DHT22 sensor.

Decalration of the DHT22 class

Member Function Documentation

◆ begin()

void SensorDHT::begin ( )

Constructor for the SensorDHT class.

Parameters
pinPin number where the DHT22 sensor is connected

◆ getHumdity()

float SensorDHT::getHumdity ( ) const

Get the humidity value.

Returns
float The humidity value in percentage

◆ getTemperature()

float SensorDHT::getTemperature ( ) const

Get the temperature value.

Returns
float The temperature value in Celsius

◆ update()

void SensorDHT::update ( )

Update the temperature and humidity values.

This function reads the temperature and humidity from the DHT22 sensor and updates the corresponding member variables.


The documentation for this class was generated from the following files: