Adafruit TinyDHT Sensor Library
Public Member Functions | List of all members
DHT Class Reference

Class that stores the state and functions for the DHT. More...

#include <TinyDHT.h>

Public Member Functions

 DHT (uint8_t pin, uint8_t type, uint8_t count=6)
 DHT constructor. More...
 
void begin (void)
 Begins connection with device.
 
int16_t readTemperature (bool S=false)
 Reads the temperature from device. More...
 
int16_t convertCtoF (int16_t)
 Converts Celcius to Fahrenheit. More...
 
uint8_t readHumidity (void)
 Reads the humidity from the device. More...
 

Detailed Description

Class that stores the state and functions for the DHT.

Constructor & Destructor Documentation

◆ DHT()

DHT::DHT ( uint8_t  pin,
uint8_t  type,
uint8_t  count = 6 
)

DHT constructor.

Parameters
pinPin connected to the DHT
typeWhat sensor you're connecting, DHT11, DHT22, DHT21, AM2301
countUsed to set how much data to take at a time. Very few reasons to change this

Member Function Documentation

◆ readTemperature()

int16_t DHT::readTemperature ( bool  S = false)

Reads the temperature from device.

Parameters
SScale. True = Fahrenheit, False = Celcius
Returns
Returns the temperature

◆ convertCtoF()

int16_t DHT::convertCtoF ( int16_t  c)

Converts Celcius to Fahrenheit.

Parameters
cDegrees celcius
Returns
Returns the inputted degrees converted to Fahrenheit

◆ readHumidity()

uint8_t DHT::readHumidity ( void  )

Reads the humidity from the device.

Returns
Returns the humidity read from the device

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