Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
DHTesp Class Reference

Public Types

enum  DHT_MODEL_t {
  AUTO_DETECT,
  DHT11,
  DHT22,
  AM2302,
  RHT03
}
 
enum  DHT_ERROR_t {
  ERROR_NONE = 0,
  ERROR_TIMEOUT,
  ERROR_CHECKSUM
}
 

Public Member Functions

void setup (uint8_t pin, DHT_MODEL_t model=AUTO_DETECT)
 
void resetTimer ()
 
float getTemperature ()
 
float getHumidity ()
 
TempAndHumidity getTempAndHumidity ()
 
DHT_ERROR_t getStatus ()
 
const char * getStatusString ()
 
DHT_MODEL_t getModel ()
 
int getMinimumSamplingPeriod ()
 
int8_t getNumberOfDecimalsTemperature ()
 
int8_t getLowerBoundTemperature ()
 
int8_t getUpperBoundTemperature ()
 
int8_t getNumberOfDecimalsHumidity ()
 
int8_t getLowerBoundHumidity ()
 
int8_t getUpperBoundHumidity ()
 
float computeHeatIndex (float temperature, float percentHumidity, bool isFahrenheit=false)
 
float computeDewPoint (float temperature, float percentHumidity, bool isFahrenheit=false)
 
float getComfortRatio (ComfortState &destComfStatus, float temperature, float percentHumidity, bool isFahrenheit=false)
 
ComfortProfile getComfortProfile ()
 
void setComfortProfile (ComfortProfile &c)
 
bool isTooHot (float temp, float humidity)
 
bool isTooHumid (float temp, float humidity)
 
bool isTooCold (float temp, float humidity)
 
bool isTooDry (float temp, float humidity)
 
byte computePerception (float temperature, float percentHumidity, bool isFahrenheit=false)
 

Static Public Member Functions

static float toFahrenheit (float fromCelcius)
 
static float toCelsius (float fromFahrenheit)
 

Public Attributes

TempAndHumidity values
 

Protected Member Functions

void readSensor ()
 

Protected Attributes

float temperature
 
float humidity
 
uint8_t pin