Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
|
Public Member Functions | |
DHT (uint8_t pin, uint8_t type=DHT_AUTO, uint16_t minIntervalRead=READ_INTERVAL_DONT_CARE) | |
void | begin () |
float | readTemperature (bool bFarenheit=false) |
float | readHumidity () |
bool | readTempAndHumidity (TempAndHumidity &destReading, bool bFarenheit=false) |
ComfortProfile | getComfortProfile () |
void | setComfortProfile (ComfortProfile &c) |
bool | isTooHot (float temp=LAST_VALUE, float humidity=LAST_VALUE) |
bool | isTooHumid (float temp=LAST_VALUE, float humidity=LAST_VALUE) |
bool | isTooCold (float temp=LAST_VALUE, float humidity=LAST_VALUE) |
bool | isTooDry (float temp=LAST_VALUE, float humidity=LAST_VALUE) |
float | getHeatIndex (float tempCelsius=LAST_VALUE, float percentHumidity=LAST_VALUE, bool bFarenheit=false) |
double | getDewPoint (uint8_t algType=DEW_ACCURATE_FAST, float tempCelsius=LAST_VALUE, float percentHumidity=LAST_VALUE, bool bFarenheit=false) |
float | getComfortRatio (ComfortState &destComfStatus, float temp=LAST_VALUE, float percentHumidity=LAST_VALUE) |
ErrorDHT | getLastError () |
Static Public Member Functions | |
static float | convertCtoF (float c) |
static float | convertFtoC (float f) |
|
inline |
Constructor.
pin | - the GPIO [in number the sensor is hooked up to |
type | - the sensor type |
minIntervalRead | - The minimum time between reads in ms |
void DHT::begin | ( | ) |
Must be called once at startup
float DHT::getComfortRatio | ( | ComfortState & | destComfStatus, |
float | temp = LAST_VALUE , |
||
float | percentHumidity = LAST_VALUE |
||
) |
Get the heuristic COMFORT RATIO (0=unconfortable..100=confortable) based on current comfort profile.
tempCelsius | - temp in *C. Default uses the last temp reading. If the reading is old, a read() is triggered This can be disabled with the NO_AUTOREFRESH switch |
percentHumidity | - humidity 0..100. Default uses the last humid reading. If the reading is old, a read() is triggered This can be disabled with the NO_AUTOREFRESH switch |
destComfStatus | - will receive a comfort classification |
double DHT::getDewPoint | ( | uint8_t | algType = DEW_ACCURATE_FAST , |
float | tempCelsius = LAST_VALUE , |
||
float | percentHumidity = LAST_VALUE , |
||
bool | bFarenheit = false |
||
) |
Get the calculated DEW POINT
tempCelsius | - temp in *C. Default uses the last temp reading. If the reading is old, a read() is triggered This can be disabled with the NO_AUTOREFRESH switch |
percentHumidity | - humidity 0..100. Default uses the last humid reading. If the reading is old, a read() is triggered This can be disabled with the NO_AUTOREFRESH switch |
algType | - Algorithm type to use. See DHT.c for details |
float DHT::getHeatIndex | ( | float | tempCelsius = LAST_VALUE , |
float | percentHumidity = LAST_VALUE , |
||
bool | bFarenheit = false |
||
) |
Get the calculated HEAT INDEX
tempCelsius | - temp in *C. Default uses the last temp reading. If the reading is old, a read() is triggered This can be disabled with the NO_AUTOREFRESH switch |
percentHumidity | - humidity 0..100. Default uses the last humid reading. If the reading is old, a read() is triggered This can be disabled with the NO_AUTOREFRESH switch |
bFarenheit | - true if a conversion to Farenheit is desired |
|
inline |
Gets the last occurred error.
float DHT::readHumidity | ( | ) |
Read humidity. Compatible with Adafruit's lib
bool DHT::readTempAndHumidity | ( | TempAndHumidity & | destReading, |
bool | bFarenheit = false |
||
) |
Read both temperature and humidity.
destReading | - will hold the temp and humidity readings |
bFarenheit | - true if a conversion to Farenheit is desired |
float DHT::readTemperature | ( | bool | bFarenheit = false | ) |
Read temperature. Compatible with Adafruit's lib(only for DHT_RUNTIME)
bFarenheit | - true if a conversion to Farenheit is desired |