SmartCradle v1
Baby smart cradle
dht.h File Reference

Temperature and Humidity sensor module header. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DHT11
 DHT11 Data structure CompleteSample: receives all the data from the sensor. More...
 

Typedefs

typedef struct DHT11 dht11_t
 DHT11 Data structure CompleteSample: receives all the data from the sensor. More...
 

Functions

void initDHT11 (void)
 Loads the sensor device driver. More...
 
void remDHT11 (void)
 Removes the sensor device driver. More...
 
int readDHT11 (dht11_t *data)
 Sample from the sensor. More...
 

Detailed Description

Temperature and Humidity sensor module header.

Author
José Carvalho, João Carneiro
Date
2022-01-13

Definition in file dht.h.

Typedef Documentation

◆ dht11_t

typedef struct DHT11 dht11_t

DHT11 Data structure CompleteSample: receives all the data from the sensor.

TemperatureI: Integer part of the temperature

TemperatureD: Decimal part of the temperature

HumidityI: Integer part of the humidity

HumidityD: Decimal part of the humidity

Function Documentation

◆ initDHT11()

void initDHT11 ( void  )

Loads the sensor device driver.

Definition at line 17 of file dht.c.

◆ readDHT11()

int readDHT11 ( dht11_t data)

Sample from the sensor.

Reads from the device driver all of the sensor data (temperature, humidity and checksum)

Parameters
dataPointer to dht11_t structure
Returns
int: Returns 0 on error, or 1 if sucessful

Definition at line 25 of file dht.c.

◆ remDHT11()

void remDHT11 ( void  )

Removes the sensor device driver.

Definition at line 21 of file dht.c.